Friday, December 28, 2007

Alter Database Authorization in SqlServer 2005

"Database diagram support object can not 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 object "

I have resolved the above issue few days ago by alter database authorization. According to MSDN the Alter Authorization syntaxt is

ALTER AUTHORIZATION
ON [ :: ] entity_name
TO { SCHEMA OWNER | principal_name }

::=
{
Object | Type | XML Schema Collection | Fulltext Catalog | Schema
| Assembly | Role | Message Type | Contract | Service
| Remote Service Binding | Route | Symmetric Key | Endpoint
| Certificate | Database
}


my SQL statement was

ALTER AUTHORIZATION ON Database::databasename TO username;

Hope it will help you. Enjoy!

No comments: