Supported versions in SQL Server 2014? - sql

Does SQL Server 2014 support lower versions of databases? Can I open and modify a database created by a lower version of SQL Server?

You can restore and/or attach a database from a lower version of SQL Server (2005 or newer - 2000 no longer supported) to SQL Server 2014 - yes, no problem.
But once it has been attached/restored, it becomes a SQL Server 2014 database - the internal file structures of the .mdf and other files are upgraded to SQL Server 2014 level, and you can never "go back" (e.g. you cannot backup from SQL Server 2014 and then restore in earlier versions)

Related

SQL Server 2000 database after restore to 2005 is empty

I have very old backup file (.bak) of SQL Server 2000. After restoring it to SQL Server 2005, the database looks empty (please see screenshot).
What is the probable cause?
screenshot
Answer for other people looking for solution:
It turns out that the database was even older than SQL2000. It was from SQL 6.5 (1996).
From previous screenshot 6.5 means database compatibility version 65 (SQL Server version 6.5. All versions described here:
https://en.wikipedia.org/wiki/History_of_Microsoft_SQL_Server
So I had to open SQL Enterprise manager 8.0 (which supports such an old database, version 65) and change compatibility level of the database to 80 (highest available, and that's compatibility version of SQL 2000). Than make a backup of DB and restore it in SQL Server 2000-2008 as lvl 80 is supported by them. Please see screenshot below:
Compatibility lvl
And you can repeat the steps so for example DB restored in SQL Server 2008 can be changed (compatibility lvl) to a 100. Back it up again and restore in SQL 2017 or higher, you can easily find compatibility level tables:
MICROSOFT WEBSITE COMPATIBILITY LEVEL

SQL Server Database Vesion

I have a problem regarding a SQL Server database.
The error message is
Cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported.
I tried everything, updating via Visual Studio 2015, downloading SQL Server 2016, installing SSMS, but nothing changed the server's version.
I need to somehow change the server's version so it will attach the the database successfully.
Please help!
You are attempting to attach SQL Server 2016 database files to SQL Server 2014. This is not supported.
Your only solution is to upgrade SQL Server from 2014 to 2016. Note, this is the database engine, not management studio.
Here is a list of all SQL Server internal database version numbers: http://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html

Restore SQL Server 2008 R2 transaction logs to SQL Server 2005

If I have SQL Server 2008R2 compatibility 90 production database and a SQL Server 2005 dev database.
Can I restore transaction logs from production to dev? Transaction logs restore from SQL Server 2008 R2 compatibility 90 to SQL Server 2005?
No, you cannot restore from newer versions to olders versions of sql server. The compatibility level of the database doesn't affect the on-disk structures. For example, you can use page and row compression (sql 2008 features) in a database that is in 90 compat mode.

Error: Can't attach DB to SQL Server 2012

I have SQL Server 2012 and I'm trying to attach a db which was previously used with SQL Server 2012, surprisingly I'm getting the following error:
The database 'DatabaseName' cannot be opened because it is version
706. This server supports version 622 and earlier. A downgrade path is not supported.
I don't really understand how this could happen since like I said it was used with same 2012 version. What am I doing wrong? How can I make it work? Please explain in detail how this can be resolved.
Thank you!!
The error sounds like the server you are trying to attach the database to is not SQL Server 2012. This may be the version of Management Studio / Management Studio Express you're using, but I suspect SELECT ##VERSION; will tell you something different. It may just be a connection string mixup if you have multiple instances of SQL Server installed, otherwise you should download and install SQL Server 2012 Express from here.
#source
It sounds like you had the following configuration and source databases:
SQL Server 2008 SP3 (ver 10.0...) - database engine
SQL Server Management Studio 2012 (ver 11.0...) - management tools
a database that was created with SQL Server 2012 (version 706)
As mentioned you could install SSMS for SQL Server 2008 (after you uninstall SSMS for SQL Server 2012). Then you would have to script your database for that version and re-run the script via 'Tasks>Script...', remembering to set the target server version as shown below.
After scripting you can then use the import/export wizard to export and then inport the data into the new (downgraded database), assuming the database had no 2012-only datatypes (such as sequences).
Another consideration is database compatibility level as shown below. You can have a SQL Server 2012 instance which hosts databases with various compatibility levels.
Using SELECT ##VERSION works very well for me. Your Database Engine is connected to a 2008 DB which certainly doesn't allow you to attach. Once I change my Database Engine to connect to 2012 DB, it works for me.
Check your Database Engine connection. You can be working on 2012 Management Studio yet connecting to 2008 DB. This is what happened to me and I have solved it use SELECT ##VERSION.

How can I attach a database?

When I want to attach database, an error occurs:
The database 'Almizan' cannot be opened because it is version 661.
This server supports version 655 and earlier. A downgrade path is not supported.
Could not open new database 'Almizan'. CREATE DATABASE is aborted.
(.Net SqlClient Data Provider)
Help me to attach this database.
Install SQL Server 2008 EXPRESS R2. There is a bug in the Web Platform Installer and it still thinks EXPRESS R1 is the latest version.
SQL Server 2008 databases are version 655. SQL Server 2008 R2 databases are 661. You are trying to attach an 2008 R2 database (v. 661) to an 2008 instance and this is not supported. Once the database has been upgraded to an 2008 R2 version, it cannot be downgraded. You'll have to either upgrade your 2008 SP2 instance to R2, or you have to copy out the data in that database into an 2008 database (eg using the data migration wizard, or something equivalent).
The message is misleading, to say the least, it says 662 because SQL Server 2008 SP2 does support 662 as a database version, this is when 15000 partitions are enabled in the database, see Support for 15000 Partitions.docx. Enabling the support bumps the DB version to 662, disabling it moves it back to 655. But SQL Server 2008 SP2 does not support 661 (the R2 version).
Think you need to upgrade the SQL Server 2008 instance (655) your trying to attach the database in, to SQL Server 2008 R2 (661), the version the database was actually created in.
See SQL Server: Attach incorrect version 661
The this answer on the MSDN seems to tell us the obvious
http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/01ed3b1c-6f29-4518-a3a4-e4e35decc05f/
When you attached the database to SQL Server 2008 to compress it the
database has automatically been upgraded from SQL 2005 to to SQL
Server 2008 from the disk structucture point of view. An internal
upgrade script has been run and has modified the on-disk structure of
the database to that new version. This can be seen at the version 655.
Once this has been done you can no longer attach the upgraded database
to a lower version of SQL Server, it will fail with the error you've
seen.
This has nothing to do with the compatiblity level of the database.
The compatabilty level only prevents the engine from using some of the
new features.
In order to get the database on SQL Server 2005 again you will need to
create the database freshly and export/import the data, for example by
using the Export/Import Wizard.
Ulrike - MSFT