January 9, 2013 at 3:10 pm
Hi,
I initially took backup from SQL Server 2012 (database compatibility mode was set to SQL Server 2008 (100)) but when I try to restore that backup on SQL Server 2008 R2 it is giving me error as "Specified cast is not valid".
I would appreciate if anyone can help me or if there is any alternate solution to backup from SQL Server 2012 and successfully restore it on SQL Server 2008 R2, please let me know.
Thank you.
January 9, 2013 at 3:17 pm
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.
Best advice is to script out all the objects, create them on the older database, then copy the data.
January 9, 2013 at 4:13 pm
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.Best advice is to script out all the objects, create them on the older database, then copy the data.
+1
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
January 10, 2013 at 2:06 am
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.Best advice is to script out all the objects, create them on the older database, then copy the data.
+1, couldnt of said it better myself.
January 10, 2013 at 5:59 am
+1
Scripts (create table and etc) out with comptiable to SQL 2008.
January 10, 2013 at 7:55 am
David Webb-200187 (1/9/2013)
As far as I know, there is no way to do a backward restore, even if the database was in a compatibility mode that matched the lower version. The compatibility mode impacts how certain sql constructs behave on a database but it doesn't mean that the database is actually internally structured as a database on that native version would be. A 2012 database, no matter what the compatibility mode, is still a 2012 database internally, so a 2008 server wouldn't understand that internal structure or be able to restore it.Best advice is to script out all the objects, create them on the older database, then copy the data.
Have to agree 100%.
May 6, 2014 at 11:36 pm
Right-click the database in SQL 2012...Tasks..."Generate Scripts". Choose the "Advanced" button under "Set scripting options" and set the "script for server version" to the required database format. For "Types of data to script" choose "Schema and data".
November 27, 2014 at 8:44 am
How do you run the sql file on the destination server? My file is not small - 13Gb - and when I try to open it in SSMS 2008R2 I get the error below. The file was created in 2012.
Error HRESULT E_FAIL has been returned from a call to a COM component
November 27, 2014 at 11:10 am
george25 (11/27/2014)
How do you run the sql file on the destination server? My file is not small - 13Gb - and when I try to open it in SSMS 2008R2 I get the error below. The file was created in 2012.Error HRESULT E_FAIL has been returned from a call to a COM component
You may need to run the file using SQLCMD.
November 28, 2014 at 1:27 am
Don't script the data unless your database is under a couple hundred MB.
Script the schema, use bcp to export the data to flat files.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply