BUG: sp_renamedb Does Not Update dbname Column in SysloginsID: Q186975
|
After using the sp_renamedb system stored procedure to rename a database,
all users whose default database was the renamed database will receive the
following errors when logging in to SQL Server:
Msg No: 911 Severity: 16 State: 2
Attempt to locate entry in Sysdatabases for database <old_db_name> by
name failed - no entry found under that name. Make sure that name is
entered properly.
Msg No: 4001 Severity: 11 State: 1
Cannot open default database <old_db_name>
The dbname column in the syslogins table stores the name of the users' default database. The sp_renamedb stored procedure is not updating this column to the new database name.
To work around this problem, the system administrator (sa) should run the
statements given below. These statements will update the dbname column of
syslogins to reflect the new database name.
sp_configure 'allow updates', 1
go
reconfigure with override
go
update syslogins
set dbname = 'newdbname'
where dbname = 'olddbname'
sp_configure 'allow updates', 0
go
reconfigure with override
go
Microsoft has confirmed this to be a problem in SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Additional query words: st proc
Keywords : SSrvStProc kbbug6.50 kbbug6.00
Version : WINNT:6.0,6.5
Platform : winnt
Issue type : kbbug
Last Reviewed: April 16, 1999