extended property
create schema schema1
go
select *from sys.extended_properties where major_id=schema_id('schema1')
go
--create an extented property for schema1
EXEC sp_addextendedproperty
@name = N'schemaDescription', @value = 'this is schema1, uses to test',
@level0type=N'SCHEMA',@level0name=N'schema1';
go
go
select *from sys.extended_properties where major_id=schema_id('schema1')
go
create table schema1.ta(c1 int,c2 int)
go
create table schema1.tb(c1 int,c2 int)
go
--create an extented property for schema1.ta
EXEC sp_addextendedproperty
@name = N'table description', @value = 'this is a table under schema schema1',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta';
go
select *from sys.extended_properties where major_id=object_id('schema1.ta')
go
EXEC sp_addextendedproperty
@name = N'table111 description', @value = 'this is a table1111 under schema schema1',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'tb';
go
--create an extented property for column c1 of table schema1.ta
EXEC sp_addextendedproperty
@name = N'column description', @value = 'this is a column description',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta',
@level2type=N'column',@level2name=N'c1';
GO
EXEC sp_addextendedproperty
@name = N'column description', @value = 'this is a column2 description',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta',
@level2type=N'column',@level2name=N'c2';
GO
select *from sys.extended_properties where major_id=object_id('schema1.ta')
go
go
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'schema1', 'table',default, null, default);
go
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'schema1', 'table','ta', 'column', default);
go
select *from sys.extended_properties where major_id=schema_id('schema1')
go
--create an extented property for schema1
EXEC sp_addextendedproperty
@name = N'schemaDescription', @value = 'this is schema1, uses to test',
@level0type=N'SCHEMA',@level0name=N'schema1';
go
go
select *from sys.extended_properties where major_id=schema_id('schema1')
go
create table schema1.ta(c1 int,c2 int)
go
create table schema1.tb(c1 int,c2 int)
go
--create an extented property for schema1.ta
EXEC sp_addextendedproperty
@name = N'table description', @value = 'this is a table under schema schema1',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta';
go
select *from sys.extended_properties where major_id=object_id('schema1.ta')
go
EXEC sp_addextendedproperty
@name = N'table111 description', @value = 'this is a table1111 under schema schema1',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'tb';
go
--create an extented property for column c1 of table schema1.ta
EXEC sp_addextendedproperty
@name = N'column description', @value = 'this is a column description',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta',
@level2type=N'column',@level2name=N'c1';
GO
EXEC sp_addextendedproperty
@name = N'column description', @value = 'this is a column2 description',
@level0type=N'SCHEMA',@level0name=N'schema1',
@level1type=N'table',@level1name=N'ta',
@level2type=N'column',@level2name=N'c2';
GO
select *from sys.extended_properties where major_id=object_id('schema1.ta')
go
go
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'schema1', 'table',default, null, default);
go
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'schema1', 'table','ta', 'column', default);