Hello.
How test if the DB is in single user mode in a sql script?
Thanks.
Eduardo
Hello.
How test if the DB is in single user mode in a sql script?
Thanks.
Eduardo
You can check the sys.databases
view:
if (select user_access_desc from sys.databases where name = 'YourDb') = 'SINGLE_USER'
begin
print 'It''s in single user!'
end