Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help with 'sp_helpdb' stored proc....

Author  Topic 

interclubs
Yak Posting Veteran

63 Posts

Posted - 2004-05-02 : 11:57:20
I am trying to run the sp_helpdb stored proc in my master database (returns a list of DBs and their owners)-- which has never had any problems before. But now I am getting the following error:

"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."

Which I am assuming means that there is some old erroneous data in there that it can't make sense of, but I can't figure out how to fix it.

Anyone have any ideas?
Thanks!

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-02 : 12:32:19
Have a look at the SP and try running parts of it until you find the problem.
I guess it's with #spdbdesc
so maybe suser_sname(sid)
This would mean you have a database without an owner - restored/attached database, dropped user?
Have a look at
select name, suser_sname(sid) from master..sysdatabases

Looking at the SP I think that's the only thing it can be.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-02 : 12:33:33
How to correct it?
Maybe sp_changedbowner?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

interclubs
Yak Posting Veteran

63 Posts

Posted - 2004-05-02 : 13:44:57
ok, got it. It was a problem with ownerhship. Thru restoring DBs they had no ownsers. The sp_changedbowner proc fixed it up real nice.

Thanks guys.
Go to Top of Page

ssivaprasad
Starting Member

9 Posts

Posted - 2005-05-04 : 21:36:31
Thanks, I also encountered this problem.

I changed the owener of the some of the database where DB Owner for those database were NULL.


- S Sivaprasad
Go to Top of Page
   

- Advertisement -