It’s always fun to fix something when there is no meaningful error message. As you can see in the blog title, message id = 0 and it doesn’t tell me how to fix the issue. Here is my checklist whenever someone reports below severe error:
It’s always fun to fix something when there is no meaningful error message. As you can see in blog title, message id = 0 and it doesn’t tell me how to fix the issue. Here is my checklist whenever someone reports below error:
CHECKLIST
- First and foremost, check database consistency. This can be done by running below command in SQL Server.
DBCC CHECKDB('database_name');
- If you have nailed down to a table, then check table consistency. We can execute below command
DBCC CHECKTABLE('table_name');
- Check the LOG folder which contains ERRORLOG and look for any file named ‘SQLDump*’ at the same time when the error was reported. If you find any, you can either contact Microsoft or use the self-service by getting dump analyzed using diagnostic preview.
- If you are getting this while using extended stored procedure, then you need to run, debug by running the exact piece of code one by one. Here is one such error which had none of 3 causes.
In case you want to see the error yourself, feel free to use below code
create table #ErrorLog (column1 char(8000)) go insert into #ErrorLog exec xp_readerrorlog 'SQL Error' drop table #ErrorLog
Have you come across such error? What were the cause and solution?
Reference: Pinal Dave (https://blog.sqlauthority.com)
7 Comments. Leave new
I got this error. what is solution
I’ve faced this issue. In my cause the database was in Synchronising state (AG 2016). Hence changed it from Async to Sync and the issue is resolved.
Got this error during a Backup JOB which will run by the stored procedure
Hi Pinal,
can i run the error log code on production server
it is very urgent.
i am getting the same error while adding data file on my database. I am not able to add datafile on that database. What is the cause and what could be the solution
Per Microsoft try DBCC CHECKDB() with TABLOCK
try this.
— I had to run it a few times and got bored of manually dropping and recreating it as I debugged
drop table if exists #errorlog
— your table didn’t have the proper DDL to collect what you were trying to insert into it
create table #ErrorLog (logdate datetime, processinfo varchar(25), text varchar(max))
insert into #ErrorLog
— You were missing a few parameters. this will search the current errorlog for the terms SQL and ERROR
exec xp_readerrorlog 0, 1, “SQL”, “error”
— select * from #errorlog
drop table #ErrorLog