April 18, 2012

sp_dropextendedproperty (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_dropextendedproperty(nvarchar @name
, varchar @level0type
, nvarchar @level0name
, varchar @level1type
, nvarchar @level1name
, varchar @level2type
, nvarchar @level2name)

MetaData:

 create procedure sys.sp_dropextendedproperty  
@name sysname,
@level0type varchar(128) = NULL,
@level0name sysname = NULL,
@level1type varchar(128) = NULL,
@level1name sysname = NULL,
@level2type varchar(128) = NULL,
@level2name sysname = NULL
as
declare @ret int

if @name is null
begin
raiserror(15600,-1,-1,'sp_dropeextendedproperty')
return (1)
end

execute @ret = sys.sp_validname @name
if (@ret <> 0)
begin
raiserror(15600,-1,-1,'sp_dropeextendedproperty')
return (1)
end

BEGIN TRANSACTION

begin
EXEC %%ExtendedPropertySet().RemoveValue(Name = @name, Level0type = @level0type, Level0name = @level0name, Level1type = @level1type, Level1name = @level1name, Level2type = @level2type, Level2name = @level2name)
IF @@ERROR <> 0
begin
COMMIT TRANSACTION
return (1)
end
end

COMMIT TRANSACTION
return (0)

No comments:

Post a Comment

Total Pageviews