Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_helpdb failing with error

Status
Not open for further replies.

Zarnaya

IS-IT--Management
May 19, 2009
8
AP
Hello all!

No so long ago sp_helpdb on MS SQL 2000 began to fail with error:
Server: Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53
Cannot insert the value NULL into column 'owner', table 'tempdb.dbo.#spdbdesc___________________________________________________________________________________________________________000100000872'; column does not allow nulls. INSERT fails.
The statement has been terminated.

I execute script from one of older posts and found that db model have no owner.
But I can't change owner of db model through sp_changedbowner.
Is there any another ways to fix it?
 
I executed code
Code:
select name, suser_sname(sid)
from master.dbo.sysdatabases
where suser_sname(sid) IS NULL
and found that database model has no owner.
And I can't change it's owner through sp_changedbowner.

Please, read my question more carefully next time.
 
And I can't change it's owner through sp_changedbowner

Why not? Are you getting an error message when you try? What error message do you get? Also, what version of SQL Server are you using?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Code:
USE model
GO
SELECT db_name()
EXEC sp_changedbowner 'sa'

--------------------------------------------------------------------------------------------------------------------------------
model

(1 row(s) affected)

Server: Msg 15109, Level 16, State 1, Procedure sp_changedbowner, Line 22
Cannot change the owner of the master database.

SQL Server Enterprise edition 2000 SP4.
 
According to books on line:

The owner of the master, model, or tempdb system databases cannot be changed.

I have no idea how this could have happened or how to recover from it. Sorry. You may want to consider restoring the model database from a backup. You should probably research this a little first.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top