個人檔案Nates Stuff相片部落格清單更多 ![]() | 說明 |
|
|
10月29日 Restoring a SQL Server 2005 Database On A Different MachineIf you do a lot of programming on a SQL 2005 database, chances are this has happened to you! You restore a database and try to diagram it (or make some other change) and get this error:
TITLE: Microsoft SQL Server Management Studio Express
------------------------------ Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.
------------------------------
BUTTONS: OK
------------------------------ What a pain! Here is how you fix it!
I hope this helps someone! It's not as easy to change as I think it should be! Nathan Zaugg UPDATE:
Another possible fix is found if you are geting the error "The proposed new database owner is mapped as a user in this database"
USE MyDatabase EXEC sp_addlogin 'TempOwner' EXEC sp_changedbowner 'TempOwner' EXEC sp_changedbowner 'sa' EXEC sp_droplogin 'TempOwner' |
|
|