PowerDesigner generate SQL Server script comments

- generating annotation data table
EXEC sys.sp_addextendedproperty @ name = N'MS_Description ', @value = [% R% [N]?]% Q: COMMENT%, @ level0type = N'SCHEMA.', @ Level0name = [ ?% R% [N]] % q:. OWNER%, @ level1type = N'TABLE ', @ level1name = [% R% [N?]]% q:. TABLE%

----生成数据列的注释
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=[%R%?[N]]%.q:COMMENT%, @level0type=N'SCHEMA',@level0name=[%R%?[N]]%.q:OWNER%, @level1type=N'TABLE',@level1name=[%R%?[N]]%.q:TABLE%, @level2type=N'COLUMN',@level2name=[%R%?[N]]%.q:COLUMN%

Usage:
1. From the menu TOOLS-> RESOUCES-> DBMS, select SQL Server 2005 Micrsoft
2. Click the properties button to open the properties dialog box
3. In Script-> Objects-> Table-> TableComment: Paste the text box above value the script generating annotation data table
4. Script-> Objects-> column-> ColumnComment: paste script generating data above comments column value textbox

Guess you like

Origin www.cnblogs.com/idtjie/p/11654219.html