Compatilibity level between 2008 and 2012 - sql-server

I have this error using MSMS 2008 trying to connect to SQL 2012. The problem is that the database under SQL 2012 has compatibility level: SQL Server 2008 (100)
https://support.powerdnn.com/kb/a1781/you-receive-errors-when-connecting-to-mssql-2012-using.aspx
My question is: when you restore a SQL 2008 db in SQL 2012, even if the database has compatibility level 2008, the db is converted to 2012 and we can't put it back again in a 2008 server again?

Yes, the database format is not backwards compatible as far as I know
What you can do is use the "generate scripts" functionality to script the entire database out in SQL2008 format and run that on a 2008 server to get a working 2008 version.
Depending on the size of the DB this may be impractical though

Related

Export SQL Server 2014 database (2008 compatible) in a backup file compatible with 2012

I'm a bit stuck with this scenario. My dev VM has SQL Server 2014 on it, and I've been working on a SQL Server 2008 database. The 2008 database is listed as '2008 compatible'. I now need to put this on a demo server which has an older edition of SQL Server (2012), and I find that 2008 compatible DBs don't create 2008 compatible backups (which I would have thought would be a given).
I'm actually trying to backup from SQL 2014 and recover into SQL Server 2012. How do I get a SQL Server 2008 or SQL Server 2012 compatible backup file from my 2008 compatible database?
Thanks.
You have to script the SQL database creation, in SQL Server Management Studio :
right click on the DB -> Task -> Generate script
From there a series off dialog to choose what to generate with the SQL command creation and where, in clipboard or file (recommanded for big DB), with optionally the data as some Insert Into SQL command. To find the data option click on the "Advanced" button and search for "Type of data to script"

Snapshot for different SQL Server Version

Can I create a snapshot from SQL Server 2012 on a SQL Server 2008 R2 Server?
The goal is to build reporting and queries without locking the live database.
I need only a DB copy (Getdate()-1)
No, the SQL Server 2012 snapshot has specific SQL Server 2012 features in it that are not compatible with SQL Server 2008 R2. These are incompatibilities that you will not see. They are deep in the SQL Server engine. You cannot do this.
It's a similar concept to trying to restore a SQL Server 2012 database backup to a SQL Server 2008 R2 instance. The higher database version cannot backstep to a lower version.
You need to use a SQL Server of the same level or higher (I believe or higher) for your snapshot server.

Is SQL Server 2005 database compatible with 2008?

I don't know if the title is correct but well what I'd like to ask: is it possible to import my database from SQL Server 2005 to 2008 or is the database in SQL Server 2005 compatible with 2008? I'm still a newbie.
Thanks
You can restore an SQL Server 2005 database on SQL Server 2008.
You can not restore an SQL Server 2008 database on SQL Server 2005.
Generally speaking, at the time of writing,
you can restore any database starting from SQL Server 2005 on a newer version of SQL Server (up to 2016), and
you can not restore any database on an earlier version.
You might want to increase the compatibility level of your DB after restoring it on a newer SQL Server version.
Yes. They are compatible. You can use a backup to transfer all the data.

SQL Server express backup

Can I use a SQL Server Express database backup file to restore that database on a full fledged version of SQL Server. I am particularly looking at SQL Server 2008 Express to SQL Server 2012 Enterprise. And if so how?
Lets be clear about one thing first, SQL Server Express , Standard and Enterprise are the Editions.
SQL Server 2005 , 2008, 2008 R2 and 2012 are SQL Server versions.
Now coming to your question whether you can restore a database from 2008 Express to 2012 Enterprise?
The Simple Answer would be YES you can.
A couple of things to keep in mind.
SQL Server Editions has no limitation you can backup and restore databases from one Edition to another without any restrictions (Except SQL Server Express which can only accommodate databases upto 10 GB). Other than this size limitation in SQL Server express, all is good.
Whereas SQL Server Versions has a very strict limitation, You can go up 3 versions but cannot go down at all.
For example if you had taken a backup on SQL Server 2008 (regardless of Edition) you can restore this backup onto a SQL Server 2008, 2008 R2 , 2012 and I think also on 2014. But you cannot restore this onto a SQL Server 2005.
I hope the explanation clears some confusions.

Are there glitches with trying to use SQL Server Management Studio 2008 R2 to manage MSSQL 2005 DB instances?

I'm currently using Microsoft SQL Server Management Studio ver. 9.00.4035.00 to manage my SQL Server 2005 (90) compatible databases.
Will I encounter problems should I attempt to upgrade the Management Studio software to SQL Server Management Studio 2008 R2 to manage MSSQL 2005 DB instances? I will not be upgrading the version of the database instance.
My personal expreience says that you wont have any migration issues if you have sql server 2005 db instances. The attach and detach of DB is same in 2008 version. Only thing is, once you use a 2005 instance DB and attach it to 2008 version, it cannot be used with 2005 version again. Apart from that, from functionality point of view, there are no issues, you can continue to use the 2005 version DB on 2008 as normal.
link for moving the DB from 2005 to 2008 -
http://www.packtpub.com/article/moving-a-database-from-sql-server-2005-to-sql-server-2008-in-three-steps
EDIT: Incase you want to move back to 2005 version for same DB instance, I dont think it will be possible except for doing a data export import onto new 2005 DB instance.

Resources