World Search

Thursday, May 25, 2017

Unable to open the physical file , operating system error 5. (Access is denied)


1. Add permissions to the disk contain Data and Log files
2. Add service account to login with SA
3. Take DB offline
    Alter database DB_NAME set offline with rollback immediate
4. Bring back the DB online
    Alter database DB_NAME set online with rollback immediate

this resolves the issue, else we need to try restarting SQL Services. Worst-case we need to restore the database with latest backup.

Tuesday, April 18, 2017

SQL 2016 - A severe error occurred on the current command. SQL Server Error Log / SQL Services Not coming online

The SQL Server Error log fails with the below error:

A severe error occurred on the current command.  The results, if any, should be discarded. (Microsoft SQL Server, Error: 0)

Solution 1: Repair SSMS tools of SQL Server 2016.
Solution 2: Repair the SQL Server Instance.
Solution 3: Create alias under SQL Server network configuration.


Solution 3 will be more appropriate when we see the below error in windows event viewer along with the above mentioned error.

Severity: 16 Error:-1, OS: -1 [Microsoft][ODBC Driver 13 for SQL Server]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].


Saturday, March 4, 2017

Maximum Worker Thread

About Worker Thread:

When a request is received, SQL Server will try to locate an idle thread to schedule the request. If an idle worker was not located, new worker will be created. If all workers have been created and none is idle, then the request is queued which will be picked up by any worker thread from the pool of worker threads created.

The following table shows the automatically configured number of max worker threads for various combinations of CPUs and versions of SQL Server.

Up-to 4 processors
Octa-Core 8 processors
16 processors
32 processors
64 processors
128 processors
256 processors

-- show Max number of worker threads on the SERVER
select serverproperty('instancename') as instancename, max_workers_count  as 'AllowedOn64Bit' from sys.dm_os_sys_info 

-- show number Current no of worker threads
select serverproperty('instancename') as instancename, COUNT(*) as MAXCOUNT  from sys.dm_os_workers

-- show the THREADPOOL wait time
select * from sys.dm_os_wait_stats where wait_type = 'THREADPOOL'

---- most of the sessions are waiting for LCK_M_S
select * from sys.dm_os_waiting_tasks

Friday, March 3, 2017

SQL Server 2000 - the application failed to start because msvcr71.dll or msvcp71.dll was not found

Error:The application failed to start because msvcr71.dll or  msvcp71.dll  was not found  

These files must be present on C:|Windows\System32 folder and also they should be present on SQL\Binn folder, either any software installation/upgrade /Anti virus might bombed these files.


1. Search these files on the computer.
2. Paste them to SQL Binaries folder  - C:\Pf\MS\MSSQL\Binn
3. Paste them to C:\Windows\System32 folder also
4. Bring SQL Services online

Hope it helps someone! Thanks.

SQL Server Agent can't Connect-Comes Online - 2016

ERROR: SQLServerAgent could not be started (reason: Unable to connect to server 'WIN\Group'; SQLServerAgent cannot start).


1. Connect to SQL Server Instance
2. Go to SQl Server Agent
3. Select -> right Click -> properties -> choose Connection
4. paste instance name as follows\instance_name
5. Click ok 

Now go to failover cluster manager and bring agent online. Issue resolved.

Friday, January 20, 2017

Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".


OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".


There are several solutions on this, but for us the below solution worked great.

Step 1:

sp_configure 'show advanced options', 1;
sp_configure 'Ad Hoc Distributed Queries', 1;
Step 2:

USE [master]

EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1

EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
Step 3:

Full permissions on C:\Users\MSSQLSERVER\AppData\Local\Temp and C:Windows\ServiceProfiles\NetworkService\AppData\Local  for windows nt groups

Thanks to:

Monday, September 26, 2016

Your account information could not be verified - SQL Server 2005 - SP4


"your account information could not be verified. Press OK to return to Authentication Mode screen to determine reason for failure.For setup to verify your credentials the services must be startable,connectable,and you must be a SQL Server Administrator"


1) Go to the active node where SQL Server 2005 is running
2) Run the setup from CMD, SQLServer2005SP4-KBXXXXXXX-x86-ENU.exe /passive 
3) Repeat same on all nodes.