How To Remove Diagramming Support Objects From Sql Server?
I need to remove diagramming support tables, stored procs, views, etc from SQL Servrer using TSQL script. Is there such a script available? SQL 2005 and 2008.
Solution 1:
DROPPROCEDURE dbo.sp_alterdiagram;
DROPPROCEDURE dbo.sp_creatediagram;
DROPPROCEDURE dbo.sp_dropdiagram;
DROPPROCEDURE dbo.sp_helpdiagramdefinition;
DROPPROCEDURE dbo.sp_renamediagram;
DROPPROCEDURE dbo.sp_upgraddiagrams;
DROPPROCEDURE dbo.sp_helpdiagrams;
DROPFUNCTION dbo.fn_diagramobjects;
DROPTABLE dbo.sysdiagrams;
That removes all of them. Would be nice if there was as remove diagrams references wizard like the add.
Solution 2:
You can drop the objects, but a user will be prompted to recreate them when they click the diagrams node.
Objects:
- sp_upgraddiagrams
- sp_helpdiagrams
- sp_helpdiagramdefinition
- sp_creatediagram
- sp_renamediagram
- sp_alterdiagram
- sp_dropdiagram
- fn_diagramobjects
- sysdiagrams
- dt_properties (?)
Solution 3:
DELETEFROM sysdiagrams -- remove all diagramDELETEFROM sysdiagrams WHERE name ='yourDiagram'-- remove with condition
Post a Comment for "How To Remove Diagramming Support Objects From Sql Server?"