Sunday, 3 April 2011

assigning permission in SQL server to create database diagram


I was required to create database diagram to view the database object but the user i have logged in was not able to view the feature. After goggling i have analyzed that user is not having enough permission.


Run the following code in sql analyzer to assign the permission to a user to create a database design


EXEC sp_dbcmptlevel 'data_base_name', '90';
go
ALTER AUTHORIZATION ON DATABASE::'data_base_name TO "domain\userid"
go
use ['data_base_name]
go
EXECUTE AS USER = N'dbo' REVERT
go