zoukankan      html  css  js  c++  java
  • PowerDesigner之设置(1)

    这里用到的数据库为SQL2000。

    PowerDesigner 16.

    原始格式:

    (个人认为的缺点)

    1. 创建表前先将原来的表删除(创建表逻辑,假如存在则drop。假如原来有数据,用drop就有问题。新的逻辑为假如存在则不创建。)
    2. 表名无中文名显示
    3. 列名无中文名显示
    if exists (select 1 from sysobjects where id = object_id('table1') and type = 'U') 
      drop table table1 go /*==============================================================*/ /* Table: table1 */ /*==============================================================*/ create table table1(   XH int not null,   constraint PK_table1 primary key (XH) ) Go

    新格式:

    /*==============================================================*/
    /* Table: table1 表1                                            */
    /*==============================================================*/
    if not exists (select 1 from sysobjects where id = object_id('table1') and type = 'U')
    create table table1 (
      XH     int        not null ,--序号,
      constraint PK_table1 primary key (XH)
    )
    Go

     设置点:

    1. 修改table的create中Value值

      主菜单DataBase->Edit Current DBMS->Script->Objects->Table->Create中Value值 修改。

      原:

      create table [%QUALIFIER%]%TABLE% (

      %TABLDEFN%

      )

      [%OPTIONS%]

      新:

      /*==============================================================*/

      /* Table: %18:Code%%30:Name% */

      /*==============================================================*/

      if not exists (select 1 from sysobjects where id = object_id('[%QUALIFIER%]%TABLE%') and type = 'U')

      create table [%QUALIFIER%]%TABLE% (

      %TABLDEFN%

      )

      [%OPTIONS%]

      上面代码中%num中num表示长度。

      而后将原table的title(原来不带中文表名部分内容)去掉。这里用了个笨方法,如哪位有高招,请赐教。由于Name为中文,导致后面的*/对齐有问题,目前还没有解决,望高手赐教。注意,这里要设置Encoding(主菜单DataBase->Generate DataBase->Format)为GB2312.

      路径:主菜单DataBase->Generate DataBase->Format->Title勾掉。

      将原来drop table判断部分去掉。

      路径:主菜单DataBase->Generate DataBase->Options中Table&Column部分Drop Table去掉。如下图

    2. 添加列备注

      修改Column的Add中Value值

      主菜单DataBase->Edit Current DBMS->Script->Objects->Column->Add中value值。

      %20:COLUMN% [%COMPUTE%?AS (%COMPUTE%):%20:DATATYPE%[.Z:[ collate %ExtCollation%][%ExtRowGuidCol%? RowGuidCol][%IDENTITY%? %IDENTITY%[[(%ExtIdentitySeedInc%)][%ExtIdtNotForReplication%? not for replication]]:[%ExtNullConstName%? constraint %ExtNullConstName%][ %:NULL%][ %:NOTNULL%]][[%ExtDeftConstName%? constraint %ExtDeftConstName%] default %:DEFAULT%]]--%COLNNAME%

      [%CONSTDEFN%]]

      %20:COLUMN% [%COMPUTE%?AS (%COMPUTE%):%20:DATATYPE%[.Z:[ collate %ExtCollation%][%ExtRowGuidCol%? RowGuidCol][%IDENTITY%? %IDENTITY%[[(%ExtIdentitySeedInc%)][%ExtIdtNotForReplication%? not for replication]]:[%ExtNullConstName%? constraint %ExtNullConstName%][ %20:NULL%][ %20:NOTNULL%]][[%ExtDeftConstName%? constraint %ExtDeftConstName%] default %20:DEFAULT%]][%20:CONSTDEFN%]],--%COLNNAME% 

      主要为添加--%COLNNAME%注释,前面%20中添加20为了格式对齐。

  • 相关阅读:
    stone brook Introduction to Mathematical Statistics
    mongodb python
    CodesBay
    人机交互的本质是画图
    Latex模版–Review and Response Letters
    mongo with python
    OpenStack架构学习与解析
    Python类方法
    python装饰器
    java.sql.SQLException: Io 异常: Connection reset by peer: socket write error
  • 原文地址:https://www.cnblogs.com/liuke1987/p/3228395.html
Copyright © 2011-2022 走看看