Extended attributes in SqlServer

Source: Internet
Author: User

In SQL server 2000, microsoft added extended attributes to help you define and operate user-defined attributes on multiple database objects. You can use these user-defined attributes to add metadata to your database. You can use system stored procedures

Sp_addextendedproperty
Sp_updateextendedproperty
Sp_dropextendedproperty

To manage these attributes. In addition, you can use system functions

Fn_listextendedproperty ()
Search for existing property values. Microsoft uses extended attributes to write and manage description values, which are associated with columns in the SQL server Enterprise Manager table design view.
Use the system stored procedure sp_addetendedproperty to add the extended attributes of a column in a table
For example:
The following example adds an attribute ('caption, ''employee id') to the "ID" column of table "T1.
CREATE table T1 (id int, name char (20 ))
GO
EXEC sp_addextendedproperty 'caption ', 'employee id', 'user', dbo, 'table', T1, 'column', ID

 

List all extended attributes of the current database
Select * from: fn_listextendedproperty (NULL, NULL)

Original post address: http://www.cnblogs.com/kid-li/archive/2005/12/31/308684.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.