Saturday, May 24, 2014

Restoring a database from a backup using T-SQL (Transact SQL)

If you refer to MSDN for guidance on how to accomplish this, you will probably encounter these 2 articles:

RESTORE (Transact-SQL)

How to: Restore a Database to a New Location and Name (Transact-SQL)

Unfortunately, the provided examples are dependent on the usage of a backup device.  If you do not want to bother with creating a backup device, then you are better off following this article:

Of course, if you have an older database backup and want to update the compatibility level to the latest version of SQL Server, then you will also have to run this command:

ALTER DATABASE Compatibility Level (Transact-SQL)

No comments:

Post a Comment