sp_dropextendedproperty (Transact-SQL)
Drops an existing extended property.
sp_dropextendedproperty
[ @name= ] { 'property_name' }
[ , [ @level0type= ] { 'level0_object_type' }
, [ @level0name= ] { 'level0_object_name' }
[ , [ @level1type= ] { 'level1_object_type' }
, [ @level1name= ] { 'level1_object_name' }
[ , [ @level2type= ] { 'level2_object_type' }
, [ @level2name= ] { 'level2_object_name' }
]
]
]
]
For the purpose of specifying extended properties, the objects in a SQL Server database are classified into three levels: 0, 1, and 2. Level 0 is the highest level and is defined as objects contained at the database scope. Level 1 objects are contained in a schema or user scope, and level 2 objects are contained by level 1 objects. Extended properties can be defined for objects at any of these levels. References to an object in one level must be qualified with the types and names of all higher level objects.
Given a valid property_name, if all object types and names are null and a property exists on the current database, that property is deleted. See example B that follows later in this topic.
Members of the db_owner and db_ddladmin fixed database roles may drop extended properties of any object with the following exception: db_ddladmin may not add properties to the database itself, or to users or roles.
Users may drop extended properties to objects they own or on which they have ALTER or CONTROL permissions. For a complete list of required permissions, see Using Extended Properties on Database Objects.
A. Dropping an extended property on a column
The following example removes the property 'caption' from column id in table T1 contained in the schema dbo.
CREATE TABLE T1 (id int , name char (20));
GO
EXEC sp_addextendedproperty
@name = 'caption'
,@value = 'Employee ID'
,@level0type = 'schema'
,@level0name = dbo
,@level1type = 'table'
,@level1name = 'T1'
,@level2type = 'column'
,@level2name = id;
GO
EXEC sp_dropextendedproperty
@name = 'caption'
,@level0type = 'schema'
,@level0name = dbo
,@level1type = 'table'
,@level1name = 'T1'
,@level2type = 'column'
,@level2name = id;
GO
DROP TABLE T1;
GO
B. Dropping an extended property on a database
The following example removes the property named MS_Description from the AdventureWorks sample database. Because the property is on the database itself, no object types and names are specified.
USE AdventureWorks; GO EXEC sp_dropextendedproperty @name = N'MS_Description'; GO


Important