How can I restore a database backup file (.bak) from SQL Server 2012 into SQL Server 2008 Express?

stormwild picture stormwild · May 25, 2012 · Viewed 62.6k times · Source

A database that was originally from SQL Server 2008, was restored into SQL Server 2012. A backup from SQL Server 2012 was made and I am trying to restore it on my local SQL Server 2008 Express. However I get an error 'Specified cast is not valid' (SQLManagerUI).

I have generated an SQL Script from 2012 and set it so that it will generate with compatibility to SQL Server 2008. However it is a large sql file, around 700mb.

I recall before that I had tried to run a script of that size before on my local SQLExpress and also got an error.

Is there a way I can get a "large" database from SQL Server 2012 into SQL Server 2008 Express?

Answer

stormwild picture stormwild · May 28, 2012

Thanks to Marc and Aaron for providing the answers.

The quick answer is no, it's not possible to restore a backup file from a higher version to a lower version of SQL Server.

A work around would be to generate the scripts to create the database.

You can target the script generation to a lower version.

Please see comments above for more information.

Links:

Why an SQL Server Database from a higher version cannot be restored onto a lower version of SQL Server?

Create Database in SQL Server 2012, Script and Use in 2008?