General Error Message (Volume 3)

SP_HELPDB error, it is not running properly –

The exact error that you may see is something like the following:

Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53 Cannot insert the value NULL into column ”, table ”; column does not allow nulls. INSERT fails.The statement has been terminated.

Cause : This is caused by missing owner of a database.

Please run the following query in Query Analyser.

select name, suser_sname(sid) from master.dbo.sysdatabases where suser_sname(sid) is null


SELECT name, suser_sname(sid), convert(nvarchar(11), crdate),dbid, cmptlevel FROM master.dbo.sysdatabases

Remember, If Null is reported run the following to generate the query to fix the issue.

SELECT ‘USE ‘ + name + ‘; EXEC sp_changedbowner ”sa”;’
FROM master.dbo.sysdatabases WHERE suser_sname(sid) IS NULL

This would generate Query to change the dbowner for problem database.

USE Mydatabase; EXEC sp_changedbowner ‘sa’;
USE Report; EXEC sp_changedbowner ‘sa’;


SQL SERVER – Fix : Error 701 There is insufficient system memory to run this query

Solution : We need to first check configuration for both min server memory (MB) and max server memory (MB). All you need to increase the max server memory (MB) value.

Just check for the configuration /size of the virtual memory paging file. If possible, increase that.

SQL Server 2005: You may check for the latest hotfix in order to resolve this issue.

You may also try using following DBCC Commands can be used to free memory:



SQL Agent – Agent XPs Disabled

Sometime we see this info on SQL Agent Link.

We have to use Query Analyser and run the following:-

sp_configure ‘show advanced options’, 1;
sp_configure ‘Agent XPs’, 1;

This would enable SQL Agent xps for related sql instance only.


Msg 829, Level 21, State 1, Line 1
Database ID 6, Page (1:1324) is marked RestorePending, which may indicate disk corruption. To recover from this state, perform a restore

Solution :

Generally this error happens when there is incomplete I/O operation…

Restoring from the backup is the best option in this case…

Is write cache enabled on disk/san controller?

Read the following article too…

SQL Server 7.0, SQL Server 2000, and SQL Server 2005 logging and data storage algorithms extend data reliability

This message you’d get if someone’s run a page restore and not completed the operation.

Have you verified that there are no page restores currently happening on the database?

What version of SQL 2k5 are you running? (SP3 or above?) Because if you’re running a service pack less than that, I advise running DBCC CheckDB with ALL_ERRORMSGS to make sure you’re getting the full list of errors.

If not, then I suggest you do as the error message states and restore the database, or at least the page if you have the db set up for page-level restores.

Please verify that the database in question isn’t actually restoring pages or anything else.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: