procedures key icon Procedure: sp_helpdiagramdefinition

Properties

Property Value
Name sp_helpdiagramdefinition
ID 1623676832
Schema dbo
Owner dbo
Type SQL STORED PROCEDURE
Execute As dbo
Encrypted false
ANSI NULLS true
Uses Quoted Identifier true
Published false
Schema Published false
Execution Replicated false
Replication Serializable Only false
Skips Replication Constraints false
Is Recompiled false
Uses Database Collation false
Null on Null Input false
MS Shipped false
Modify Date 6/20/2011 3:16:00 PM
Create Date 6/20/2011 3:16:00 PM

Extended Properties

No extended properties defined.

Permissions

Permissions for: guest

Permission Grantor Grant With Grant Option Deny
Alter
Control
Execute dbo true
Take Ownership
View Definition

Permissions for: public

Permission Grantor Grant With Grant Option Deny
Alter
Control
Execute dbo true
Take Ownership
View Definition

Parameters

Parameter Name Datatype Output Cursor Ref Readonly Has Default Value Default Value Xml Collection Name Description
@diagramname sysname false false false false
@owner_id int false false false false

Objects that depend on [sp_helpdiagramdefinition]

Objects on which [sp_helpdiagramdefinition] depends

SQL

Script
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE PROCEDURE dbo.sp_helpdiagramdefinition ( @diagramname sysname, @owner_id int = null ) WITH EXECUTE AS N'dbo' AS BEGIN set nocount on declare @theId int declare @IsDbo int declare @DiagId int declare @UIDFound int if(@diagramname is null) begin RAISERROR (N'E_INVALIDARG', 16, 1); return -1 end execute as caller; select @theId = DATABASE_PRINCIPAL_ID(); select @IsDbo = IS_MEMBER(N'db_owner'); if(@owner_id is null) select @owner_id = @theId; revert; select @DiagId = diagram_id, @UIDFound = principal_id from dbo.sysdiagrams where principal_id = @owner_id and name = @diagramname; if(@DiagId IS NULL or (@IsDbo = 0 and @UIDFound <> @theId )) begin RAISERROR ('Diagram does not exist or you do not have permission.', 16, 1); return -3 end select version, definition FROM dbo.sysdiagrams where diagram_id = @DiagId ; return 0 END
EXEC sys.sp_addextendedproperty @name=N'microsoft_database_tools_support', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpdiagramdefinition'

See also

List of Procedures