Monday, April 9, 2012

Msg 515, Level 16, State 2, Procedure sp_helpdb -- Error while running sp_helpdb

The issue may occur because one of the database owner might be null.
SELECT name, suser_sname(sid), dbid, cmptlevel FROM master.dbo.sysdatabases

To get around the issue we need to figure out which database do not have a valid owner by using the above command. If owner is null the sp_helpdb throws error.

USE KalyanDB

EXEC sp_changedbowner 'sa';

No comments: