Showing posts with label Rename database. Show all posts
Showing posts with label Rename database. Show all posts

Tuesday, 17 February 2015

Error messages when restoring from different versions of SQL Server.


Error messages when restoring from different versions of SQL Server.



We can't restore the backups taken in Newer version of SQL Server instance on older version of SQL Server. 

SQL Server 2008 R2 to SQL Server 2008
Msg 3169, Level 16, State 1, Line 1
The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.1600. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


SQL Server 2008 R2 to SQL Server 2005
Server: Msg 3241, Level 16, State 7, Line 1
The media family on device 'f:\temp\test001_sql2008r2.bak' is incorrectly formed. SQL Server cannot process this media family.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.



SQL Server 2008 R2 to SQL Server 2000
Server: Msg 3169, Level 16, State 1, Line 1
The backed-up database has on-disk structure version 661. The server supports version 539 and cannot restore or upgrade this database.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


SQL Server 2008 to SQL Server 2005
Server: Msg 3241, Level 16, State 7, Line 1
The media family on device 'f:\temp\test001_sql2008.bak' is incorrectly formed. SQL Server cannot process this media family.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.



SQL Server 2008 to SQL Server 2000
Server: Msg 3169, Level 16, State 1, Line 1
The backed-up database has on-disk structure version 655. The server supports version 539 and cannot restore or upgrade this database.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.



SQL Server 2005 to SQL Server 2000
Server: Msg 3169, Level 16, State 1, Line 1
The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.






Thursday, 8 January 2015

Rename the sql server database


There are couple of options are available to rename the database. 
Option 1 : 
 Rename the "MyDATABASE" to "MyDATABASE_NEW" using sp_renamedb command

 EXEC sp_renamedb 'MyDATABASE', 'MyDATABASE_NEW' 

Option 2:
 Rename the "MyDATABASE" to "MyDATABASE_NEW" using ALTER DATABASE Commnad

USE [master]
GO

ALTER DATABASE [MyDATABASE] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE [MyDATABASE] MODIFY NAME = MyDATABASE_NEW
GO
ALTER DATABASE [MyDATABASE_NEW] SET MULTI_USER
GO