Error: Cannot Insert the value NULL into column '', table ''; - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2012-02-09T08:36:19Zhttp://fogbugz.stackexchange.com/feeds/question/258http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/258/error-cannot-insert-the-value-null-into-column-tableError: Cannot Insert the value NULL into column '', table '';FogBugz KB2009-10-15T00:20:31Z2011-06-22T16:40:20Z
<p>I'm getting the following error message:</p>
<p><img src="http://www.fogcreek.com/FogBugz/KB/images/sp%5Fdbhelp2.gif" alt="err" title="" /></p>
<p>Any help here?</p>
http://fogbugz.stackexchange.com/questions/258/error-cannot-insert-the-value-null-into-column-table/259#259Answer by FogBugz KB for Error: Cannot Insert the value NULL into column '', table '';FogBugz KB2009-10-15T00:23:41Z2009-10-15T00:23:41Z<p><strong>Description:</strong> </p>
<p>This indicates a problem with your SQL Server installation. At least one of the databases on your database server
has a missing or corrupt owner. The system stored procedure "sp_helpdb", which lists your existing databases,
requires a valid owner for every database in order to run.</p>
<p>To see what's happening, open Query Analyzer and run: exec sp_helpdb. You will see an error message like the one above.</p>
<p><strong>Common Cause:</strong></p>
<p>Outside of SQL Server, the database owner's Windows account gets deleted. This sours things within SQL Server, it orphans that database.</p>
<p><strong>Solution:</strong></p>
<p>Following is the response I've seen two Microsoft reps post on groups. <dbname> is the database with the missing or corrupt owner.
</p>
<p>1) <br/><b>Use <dbname></b><br />
<b>exec sp_changedbowner '[<em>new user not in db already]</b></em>'<br />
--this will work & sp_helpdb will execute correctly<br />
<br />
2) Then execute the same query using sa & it will work:
<br />
<b>Use <dbname></b><br />
<b>exec sp_changedbowner 'sa'</b><br />
--The dependent aliases were mapped to the new database owner. Database owner changed.</p>
<p>Of course, you may not know which database has the problematic owner. Here's from a Microsoft Rep (view thread):</p>
<blockquote>
<p>The database owner SID will become invalid if the owner's Windows account is<br />
deleted. This causes problems with sp_helpdb because of the NULL account<br />
name returned from SUSER_SNAME().. You can identify these problem databases<br />
with the script below and correct the problem by executing sp_changedbowner<br />
with a valid login.<br />
</p>
<p>
SELECT name<br />
FROM master..sysdatabases<br />
WHERE SUSER_SNAME(sid) IS NULL<br /></p>
<br /><p> </p></b>
</blockquote></p>