Team work to design a system data model, after the creation of PDM, table, view, Store procedure and so on have been created, and create a number of schemas to facilitate the management of these database objects, but Table, view, column and other objects have comment ( Used to share descriptive information among different members of the team)
When you build the database, you get a hint that the extended property is not supported, or the object does not exist, and the analysis finds that the exception is similar to the following statement:
if exists(Select 1 fromSys.extended_properties pwherep.major_id= object_id('Environment.resource') andp.minor_id=(Selectc.column_id fromSys.columns CwhereC.object_id =p.major_id andC.name= 'Resourcecode'))begin ExecuteSp_dropextendedproperty'ms_description', 'User','Environment','Table','Resource','column','Resourcecode'EndExecuteSp_addextendedproperty'ms_description', 'Resource Encoding', 'User','Environment','Table','Resource','column','Resourcecode'Go
The reason for the analysis is that the schema (environment in the code above) is used, so the third parameter of the sp_addextendedproperty stored procedure should be schema rather than user. Query related data found that the above SQL statement is based on the corresponding. xdb file generated by PowerDesigner, as the SQL code template for the column comment information, the corresponding XDB template file is stored in the PowerDesigner installation path sybase\ PowerDesigner 16\resource Files\dbms\sqlsv2012.xdb
For example, each column's comment information is generated from the above code template, so you only need to modify the code template (the third parameter value of Sp_addextendedproperty is modified by the user to schema) The comment generation statements for all objects are corrected.
Note: You need to run PowerDesigner with administrator privileges in Win7 above to save the modified template file.
PowerDesigner 16.5 "Extended properties not supported" issue with SQL Server 2012 build Database