There is no way to change this or rename it from the Management Studio GUI, but a simple script can fix the problem.
Find the diagram you want to rename, and the new principal you want to be the "owner".
select * from dbo.sysdiagrams
select * from sys.database_principals
(abbreviated results shown below)
name principal_id diagram_id
Diagram_0 1 1
name principal_id type type_desc
dbo 1 S SQL_USER
jdoe 6 S SQL_USER
update dbo.sysdiagrams
set principal_id = 1 --dbo
where principal_id = 6 --jdoe
and diagram_id = 1
And now the diagram isn't owned by one of your developers.
No comments:
Post a Comment