Diagrams on Sql Server 2005

September 17th, 2008 by Delivery Leave a reply »

Ad una nuova installazione di Sql Server e quando faccio l’attach di un DB proveniente da Sql 2000 ho sempre il solito errore nel momento in cui cerco di aprire i diagrammi:
“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.”

Vi posto il codice da eseguire per ovviare a questo fastidioso problema che non viene via nemmeno impostando la compatibilità su Sql 2005 nelle option del DB

use [master] EXEC sp_dbcmptlevel 'TuoDatabase', '90';
go
ALTER AUTHORIZATION ON DATABASE::TuoDatabase TO tuoLogin
go
use [TuoDatabase]
go
EXECUTE AS USER = N'dbo' REVERT
go
 
Spero vi sia utile ;) 
Advertisement

Leave a Reply