Database diagrams MSSQL

Tagged Under : , ,

mssq_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.

——————————

Questo post è un promemoria per chi (come me) non si ricorda a memoria come modificare i permessi per la creazione del diagram (molto utile per la visualizzazione del DB nel suo insieme, relazioni incluse) in MSSQL Management studio e ha bisogno di una stringa da utilizzare al volo per farlo.

La query giusta da eseguire in questo caso è:


EXEC sp_dbcmptlevel '$NOMEDB', '90';

ALTER AUTHORIZATION ON DATABASE::$NOMEBD TO "$NOMEMACCHINA\$USERNAME"

ovviamente con le opportune sostituzioni sulle variabili $….cheers :-)

Comments:

Post a comment