17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 – Data Classification and RolesThe arguments for the fn_listextendedproperty system metadatafunction are:• Property Name: This is the textual reference to the property that isbeing queried.Object Level: The object hierarchy that defines thedatabase objects with which the extended property is associated. Threelevels are required. To return all objects at a given level, use the value"default". Use "null" to ignore a level after the use of "default".In our HomeLending database, we can return the sensitivity class extendedproperty for all columns in the table that store our borrower's asset accountnumbers, as shown in Listing 2-11.USE HomeLending;GOSELECTobjname as Column_Name,name as Extended_Property,value as ValueFROMfn_listextendedproperty ('Sensitivity_Class','schema', 'dbo','table', 'Asset_Account','column', default);GOListing 2-11: Querying extended properties using thefn_listextendedproperty system metadata function.Alternatively, we can query extended properties using thesys.extended_properties catalog view. Listing 2-12 shows an exampleof the syntax of this catalog view:SELECTclass as Object_Class_ID,class_desc as Object_Class_Description,major_id as Object_ID,minor_id as Column_Parameter_Index_ID,name as Extended_Property_Name,value as ValueFROMsys.extended_properties;GOListing 2-12: Querying extended properties using thesys.extended_properties catalog view.57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!