Reputation: 881
I have make a backup file from a database in SQL Server 2012.
But I can't restore it in a new database in SQL Server 2008r2 with the .bak
file.
It always returns a warning that cast is not valid(sqlmanager.ui).
Is there any way to restore it?
Upvotes: 0
Views: 70
Reputation: 754478
You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version - the internal file structures are just too different to support backwards compatibility.
You can either get around this problem by
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts
) or using a third-party tool
or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
Upvotes: 1