对于PowerDesigner中设计表自动生成Sql的分析

来源:互联网 发布:mac 视频剪辑 水平调整 编辑:程序博客网 时间:2024/06/06 06:58
if exists (select 1            from  sysobjects           where  id = object_id('DWLX')            and   type = 'U')   drop table DWLXgo/*==============================================================*//* Table: DWLX                                                *//*==============================================================*/create table DWLX (   DWLX_NM            varchar(36)          not null,   DWLX_LXBH          varchar(6)           not null,   DWLX_LXMC          varchar(64)          not null,   DWLX_LEVEL         int                  not null,   DWLX_FJNM          varchar(36)          not null,   DWLX_MX            char(1)              not null,   constraint PK_DWLX primary key nonclustered (DWLX_NM))go

分析constraint PK_DWLX primary key nonclustered (DWLX_NM)这句话:

        对表DWLX建立主键约束,主键约束的名字是:PK_DWLX ,主键列是:DWLX_NM。

        PRIMARY KEY 约束默认为 CLUSTERED;UNIQUE 约束默认为 NONCLUSTERED。此处指明该表为nonclustered索引(即非聚集索引)。

小注:

        1、Sql Server判断某个表是否存在:点击打开链接。

        2、SQL Server中clustered与nonclustered的区别 :点击打开链接。

        3、GO的意思是本语句块结束的意思,一遇到GO就直接提交到存储引擎。

              GO (Transact-SQL)官方文档:点击打开链接

0 0
原创粉丝点击