PowerDesigner 16.5 "Extended properties not supported" issue with SQL Server 2012 build Database

Source: Internet
Author: User
Tags powerdesigner

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.

Excerpt from: http://www.cnblogs.com/xqyi/p/3937769.html

Add:

Columncontent modified to:

Value is modified to:

[If exists (select 1 from  sys.extended_properties           where major_id = object_id (' [%qualifier%]%table% ') and Minor_ id = 0) begin    [%owner%?[. O:[execute][exec]]sp_dropextendedproperty [%r%?[ N]] ' ms_description ',     [%r%?[ N]] ' schema ', [%r%?[ n]]%.q:owner%, [%r%?[ N]] ' table ', [%r%?[ n]]%.q:table%:d eclare @CurrentUser sysname Select @CurrentUser = schema_name () [. O:[execute][exec]]sp_dropextendedproperty [%r%?[ N]] ' ms_description ',     [%r%?[ N]] ' schema ', [%r%?[ N]] @CurrentUser, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%] End][%owner%?[. O:[execute][exec]]sp_addextendedproperty [%r%?[ N]] ' ms_description ',     [%r%?[ n]]%.q:comment%,    [%r%?[ N]] ' schema ', [%r%?[ n]]%.q:owner%, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%: Select @CurrentUser = schema_name () [. O:[execute][exec]]sp_addextendedproperty [%r%?[ N]] ' ms_description ',     [%r%?[ n]]%.q:comment%,    [%r%?[ N]] ' schema ', [%r%?[ N]] @CurrentUser, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%]

Values are modified to:

[If exists (select 1 from sys.extended_properties p where p.major_id = object_id (' [%qualifier%]%table% ') and P.minor_ id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name =%.q:column%) begin [%owner%?[. O:[execute][exec]]sp_dropextendedproperty [%r%?[ N]] ' ms_description ', [%r%?[ N]] ' schema ', [%r%?[ n]]%.q:owner%, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%, [%r%?[ N]] ' column ', [%r%?[ n]]%.q:column%:d eclare @CurrentUser sysnameselect @CurrentUser = schema_name () [. O:[execute][exec]]sp_dropextendedproperty [%r%?[ N]] ' ms_description ', [%r%?[ N]] ' schema ', [%r%?[ N]] @CurrentUser, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%, [%r%?[ N]] ' column ', [%r%?[ n]]%.q:column%]end][%owner%?[. O:[execute][exec]]sp_addextendedproperty [%r%?[ N]] ' ms_description ', [%r%?[ n]]%.q:comment%, [%r%?[ N]] ' schema ', [%r%?[ n]]%.q:owner%, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%, [%r%?[ N]] ' column ', [%r%?[ N]]%.q:column%:select @CurrentUser = schema_name () [. O:[execute][exec]]SP_ADDEXTENDEDPROperty [%r%?[ N]] ' ms_description ', [%r%?[ n]]%.q:comment%, [%r%?[ N]] ' schema ', [%r%?[ N]] @CurrentUser, [%r%?[ N]] ' table ', [%r%?[ N]]%.q:table%, [%r%?[ N]] ' column ', [%r%?[ n]]%.q:column%]

This is a table.

Other types in the same vein, mainly modify the User in values as SCHEMA, and select @CurrentUser = USER_NAME () modified to select @CurrentUser = Schema_name ()

PowerDesigner 16.5 "Extended properties not supported" issue with SQL Server 2012 build Database

Related Article

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.