-- ============================================= -- 程序编写: Jeff -- 版 本: V 1.0 -- 建立日期: 2015-05-05 -- 功能说明: 数据库实例信息; -- 备 注: ; -- 修改日期: -- 修改说明: -- ============================================= set ansi_nulls on go set quoted_identifier on go set ansi_padding on go --判断表是否存在,不存在则创建; if not exists(select * from dbo.sysobjects where id = object_id(N'CatalogInfo') and objectproperty(id,'IsTable') = 1) begin create table [dbo].[CatalogInfo]( [enable] [bit] default(1) not null, /* 是否启用该分店实例 */ [branch] [nvarchar](24) not null, /* 分店名称 */ [branchid] [nvarchar](32) not null, /* 分店id */ [clgname] [nvarchar](24) not null, /* 数据库名 */ [clgport] [int] default(0) null, /* 数据库映射端口 */ [clgsource] [nvarchar](24) not null, /* 数据库源(地址) */ [clgaccount] [nvarchar](24) not null, /* 数据库登陆账号 */ [clgpassword] [nvarchar](16) not null, /* 数据库登陆密码 */ /* 主键分店ID */ constraint [PK_CatalogInfo] primary key clustered ( [branchid] asc ) with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on,allow_page_locks = on) on [primary], ) on [primary] end go