Sunday, March 25, 2012

authorization

how do you alter authorization to set the database owner to a valid login? and simultaneously how do you add the database diagram support objects in sql server 2005 express.

thanksThere's two ways to change the owner to a valid login:

1) Using the management UI
a) Right click on the database in Object Explorer, select properties
b) in the properties dialog, switch to the "Files" page
c) Enter the name of a login in the "Owner" edit box (or click the "..." button to browse for a login)
d) click OK

2) Using T-SQL execute the following:

ALTER AUTHORIZATION ON DATABASE::{database_name} TO {principal_name}
To install the database diagram support objects:

1) Launch Management Studio and log in as an administrator or as dbo in the database.
2) Make sure the database compatibility level is set to SQL Server 2005. You can set this in the database properties dialog on the Options page.
3) In Object Explorer, right click on the "Database Diagrams" folder for the database and select "Install Diagram Support". Click Yes in the prompt to install support objects that is displayed.

If you need to, you can set the database compatibility to a backwards compatibility mode after the diagram support objects are installed and you'll still be able to work with diagrams.

No comments:

Post a Comment