Open up MSSQL Management Studio
Then Select Database -> your Database -> right click -> Task -> Take Offline.
If the database does not make offline then you can do the following
ALTER DATABASE <dbname> SET OFFLINE WITH ROLLBACK IMMEDIATE
If this is not working then use the following to find spid
USE master SELECT * FROM sys.sysprocesses WHERE dbid = DB_ID('MyDB')
To force disconnections, use
ROLLBACK IMMEDIATE USE master ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
I have recently have this issue on SQL Server 2012 with Windows Server 2012 R2.
The error was displayed one using OLE DP Provider in the VB script connection strings.
After looking at various google post explaining this issue nothing has worked.
To confirm the server is PCI DSS compliant and TLS 1.0 < and SSL are disabled.
I have changed the connection string from
‘connstring = “Provider=SQLOLEDB.1;
connstring = “Provider=SQLNCLI11;
this is to use native SQL Client Drivers to connect.
This has worked and no more issues the script complained.
Connection Strings for SQL Server 2012