use mastergoalter database DoNet set SINGLE_USER with ROLLBACK IMMEDIATE gorestore database DoNet from disk='D:\DoNet.BAK' with replace go