mom: sp_helpdb - cannot insert the value null into column
been getting any of these errors?
the system stored procedure sp_helpdb, which is used to gather information about the databases, has returned an error that may indicate that it cannot determine the db owner for the database [databasename].
here are the details:
this generally occurs when there's no owner specified for the database. executing this query will tell you if that's the case:sp_helpdb @dbname='databasename' on sql server instance: [instancename]. error number: 515, error information: [microsoft][odbc sql server driver][sql server]cannot insert the value null into column '', table ''; column does not allow nulls. insert fails.
select name, suser_sname(sid) from master.dbo.sysdatabases where suser_sname(sid) is nullif indeed it does show up in this query, using sp_changedbowner will fix it. this will assign sa as the owner (make sure to change the database to the one you need to correct):
exec sp_changedbowner 'SA'
Helpful posting. Thanks!!
ReplyDeleteExcellent post for those of us MOM admins who don't know squat about SQL. Thx much!
ReplyDeleteVery helfull, thank you
ReplyDeleteVery good post.. helped me out! :-)
ReplyDeleteThanks a lot for your post. It's very useful
ReplyDeleteThanks, you saved my day :)
ReplyDeleteStill useful!! :)
ReplyDelete-Bryce
Good article...helped me a lot
ReplyDelete