For more information about SqlServer extension attributes, see
For more information about SqlServer extension attributes, see
The extended attributes in SqlServer help are described as follows:
The Extended Properties property sets or retrieves provider-specific connection information that cannot be explicitly described through the property mechanic.
You can perform the following operations on extended attributes:
The Code is as follows:
Exec sp_addextendedproperty N 'Ms _ description', N 'field description', N 'user', N 'dbo ',
N 'table', N 'table name', N 'column ', N 'field name'
GO
For example, EXEC sp_addextendedproperty N 'Ms _ description', N 'address', N 'user', dbo, N 'table ',
The Code is as follows:
N 'A', N 'column', a_add
GO -- my table is a. Add the field description to the field a_add: address.
Others:
Delete:
The Code is as follows:
EXEC sp_dropextendedproperty N 'Ms _ description', N 'user', dbo, N 'table', N 'table name ',
N 'column ', field name
Modify:
The Code is as follows:
EXEC sp_updateextendedproperty N 'Ms _ description', n'field description', n'user ',
Dbo, N 'table', N 'table name', 'column ', Field
As for the query, SQL server provides the system function fn_listextendedproperty ():
The Code is as follows:
-- Obtain the description of a field
SELECT *
FROM: fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'table name', 'column ',
Default) -- other variables, you can write as required, as long as the table name is changed to your
Where objname = 'field name'
You can also query the table by yourself:
The Code is as follows:
SELECT o. name AS tableName, c. name AS columnName, p. [value] AS Description
FROM sysproperties p INNER JOIN
Sysobjects o ON o. id = p. id INNER JOIN
Syscolumns c ON p. id = c. id AND p. smallid = c. colid
WHERE (p. name = 'Ms _ description ')
Order by o. name