SQL Database is in use and cannot restore

USE master
GO

ALTER DATABASE <mydatabase>
SET SINGLE_USER
--This rolls back all uncommitted transactions in the db.
WITH ROLLBACK IMMEDIATE
GO

RESTORE DATABASE <mydatabase> FILE = N'mydatabase' FROM  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\mydatabase.bak' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10
GO

Print | posted @ Friday, March 31, 2017 3:17 PM

Comments on this entry:

Gravatar # re: SQL Database is in use and cannot restore
by laibaejaz at 4/6/2017 3:29 PM

sql is still in use it never get old essayleaki have use it best database it is.
Gravatar # re: SQL Database is in use and cannot restore
by edwardcross at 4/19/2017 2:19 AM

Awesome article. I’m most definitely interest in this one. I am in reality happy with article quality and direction. This post is spot on in informative how some ideology applies to any script location. Thanks a lot for preservation huge stuff. I am extremely a good deal grateful used intended for this place. Thanks a lot for protection massive things. Visit here: http://www.speedycustomessaywriting.org/
Gravatar # re: SQL Database is in use and cannot restore
by Sonia at 4/19/2017 7:37 AM

This article is extremely valuable for all people. London Best Chauffeur Service, My learning is increment subsequent to perusing article
Gravatar # re: SQL Database is in use and cannot restore
by Sam at 4/20/2017 7:17 AM

Like your post. http://www.newintrends.com/
Post A Comment
Title:
Name:
Email:
Comment:
Verification: