Schemaexplorer Allow us to obtain information about some objects in the database. If you are using SQL Server2000 Database, you can get a lot of useful information about objects through extended attributes. For example: SQL Server An extended attribute is defined to identify the unique field in the table. You can write it in the template as follows: Identity Field = <% Foreach (Columnschema CS In Sourcetable. columns) {
If ((( Bool ) CS. extendedproperties [ " Cs_isidentity " ]. Value) = True )
{
Response. Write (CS. Name );
}
}
%>
CodesmithDefined extended attributes includeTable columns, view columns,AndCommand Parameters.
Table Columns
Cs_isrowguidcol
Cs_isidentity
Cs_iscomputed
Cs_isdeterministic
Cs_identityseed
Cs_identityincrement
Cs_default
View Columns
Cs_iscomputed
Cs_isdeterministic
Command Parameters
Cs_default
In addition, each object has Cs_description . You can also SQL Server System stored procedures in Sp_addextendedproperty To create custom extended attributes. For example, run the following command: Customer The ID Add a field Caption Extended attributes:
Sp_addextendedproperty ' Caption ' , ' Customer ID ' , ' User ' , DBO, ' Table ' , Customers, ' Column ' , ID
After executing this statement in the database, Codesmith Will be added to the extended attribute set of this field Caption Attribute. Related SQL Server For details about the extended attributes in, see books online.