Vous souhaitez définir votre base de données en mode mono-utilisateur, effectuez la restauration, puis remettez-la en mode multi-utilisateur :
ALTER DATABASE YourDB
SET SINGLE_USER WITH
ROLLBACK AFTER 60 --this will give your current connections 60 seconds to complete
--Do Actual Restore
RESTORE DATABASE YourDB
FROM DISK = 'D:\BackUp\YourBaackUpFile.bak'
WITH MOVE 'YourMDFLogicalName' TO 'D:\Data\YourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'D:\Data\YourLDFFile.ldf'
/*If there is no error in statement before database will be in multiuser
mode. If error occurs please execute following command it will convert
database in multi user.*/
ALTER DATABASE YourDB SET MULTI_USER
GO
Référence :Pinal Dave (http://blog.SQLAuthority.com )
Référence officielle :https://msdn.microsoft.com/en-us/ bibliothèque/ms345598.aspx