Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sqlserver.exe has stopped working

Since installing Visual Studio 2015 Update 3 I have been getting the below error. It happens only when Visual Studio 2015 is open and happens whether I am running as a local admin or not. It is frequent and is irritating, but does not seem to affect any work that I am doing. Code, Server Explorer, VS all work fine bat the error messages popping up and Microsoft Error Reporting taking up long periods of 50% usage of my CPU in the process.

Does anyone know how to fix this? I don't want to spend hours trying to resolve it.

Error Message:

enter image description here

In my Application event log I see the following:

Fault bucket 126419871336, type 5 Event Name: SQLException64 Response: Not available Cab Id: 0

Problem signature: P1: sqlservr.exe P2: 0.0.0.0 P3: 0000000000000000 P4: sqlmin.dll P5: 2015.130.1601.5 P6: 000000005724AE98 P7: -1073741819 P8: 0000000000064BB2 P9: 00000001D8D946AB P10:

Attached files: \?\C:\Users\m_f\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV13\SQLDump0100.mdmp \?\C:\Users\m_f\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV13\SQLDump0100.txt \?\C:\Users\m_f\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\ProjectsV13\SQLDump0100.log \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERE021.tmp.WERInternalMetadata.xml

These files may be available here: C:\ProgramData\Microsoft\Windows\WER\ReportArchive\Critical_sqlservr.exe_7113a987f49ac660cb71f97cb4183ea19827ef0_00000000_0bd7e949

Analysis symbol: Rechecking for solution: 0 Report ID: 3e38065a-5d62-11e6-89a7-97ade4354400 Report Status: 1 Hashed bucket: ff995718a61d049a3664662b84518798

And in the SQL log:

Process 49 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Is also seems to have been a known issue - see this Microsoft KB Article that says it has been patched.

My system is as up to date as possible in terms of OS, patches, security updates, Visual Studio updates etc but I still see the issue. Hopefully someone has solved this before and can save me some frustration trying to get it sorted!

Thanks

like image 219
Murray Foxcroft Avatar asked Aug 08 '16 12:08

Murray Foxcroft


People also ask

What to Do If SQL Server is not running?

Restart Your Computer It may just be that SQL Server did not properly start up during the Windows startup process. If SQL Server is still not working after the restart and you still receive the message above, then you can try to start SQL Server manually.

How do I repair SQL Server installation?

Launch the SQL Server Setup program (setup.exe) from SQL Server installation media. After prerequisites and system verification, the Setup program will display the SQL Server Installation Center page. Click Maintenance in the left-hand navigation area, and then click Repair to start the repair operation.

Where is SQL Server EXE located?

The path to this folder is C:\Program Files\ or C:\Program Files (X86)\ depending on whether the version of Windows or the program being installed is 32-bit or 64-bit.

Why has SQL service stopped?

This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling. Check the SQL error log for any related stack dumps or messages. This exception forces SQL Server to shutdown.


2 Answers

There is an ongoing thread about this crash on Microsoft's MSDN forum:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0c486ed7-9fdb-45f0-9fcd-342eadbb0476/sqlserverexe-crashing

Apparently, this crash occurs after upgrading to the most recent version of SSDT (14.0.60525.0).

A Microsoft employee suggested this as a fix:

We've investigated and believe that this happens when the query store feature is enabled in any database in the localdb server. You can work around this problem by disabling the query store feature in all localdb database instances. To find the names of databases that have query store enabled, run this query:

select [name] from sys.databases where is_query_store_on=1

Then for each database, disable query store by executing a query like so:

alter database DBNAME set query_store=off

Some reported this did not fix the issue for them, others that it did, so your success may vary.

See Microsoft employee Kevin Cunnane's comment below:

The fixed LocalDB.msi is included in the August release - available from msdn.microsoft.com/en-us/library/mt204009.aspx with update via the Visual Studio Extensions and Updates channel due in the next few weeks.

like image 197
John Washam Avatar answered Oct 05 '22 22:10

John Washam


On your localDb run following script

DECLARE @name VARCHAR(50) 
DECLARE @query VARCHAR(max)   


DECLARE db_cursor CURSOR FOR  
SELECT name 
FROM  sys.databases 
WHERE is_query_store_on=1 and name NOT IN ('master','model','msdb','tempdb')  

OPEN db_cursor   
FETCH NEXT FROM db_cursor INTO @name   

WHILE @@FETCH_STATUS = 0   
BEGIN   

set @query = 'alter database  ['+ @name+']    set query_store=off'
      EXECUTE(  @query)

       FETCH NEXT FROM db_cursor INTO @name   
END   

CLOSE db_cursor   
DEALLOCATE db_cursor

this will fix problem for all databases

like image 38
Mahdi Shahbazi Avatar answered Oct 05 '22 22:10

Mahdi Shahbazi