Code snippet: Alle verbindingen sluiten met de SQL Server database

Gebuik onderstaande SQL-snippet om alle verbindingen met een SQL Server database te sluiten:

-- set your current connection to use master otherwise you might get an error

use master
ALTER DATABASE YourDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE 

--do you stuff here 

ALTER DATABASE YourDatabase SET MULTI_USER

Reacties

Populaire posts van deze blog

IIS: Application pool recycling vs IIS Reset

Hoofdstuk 2 - Les 2

Totstandkoming estimated en actual query plans Sql Server