通过SQL脚本设置主键、自增列、默认值。
自增列:[PID] [int] IDENTITY (1, 1) NOT NULL
设置主键:这里的PK_t_LockDataNet前缀PK_不好理解,呵呵。
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD CONSTRAINT
PK_t_LockDataNet PRIMARY KEY CLUSTERED
(
PID
) ON [PRIMARY];
设置默认值:DF_t_LockDataNet_TotalNum前缀DF_表名_字段名
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD
CONSTRAINT [DF_t_LockDataNet_TotalNum] DEFAULT (5) FOR [TotalNum],
CONSTRAINT [DF_t_LockDataNet_DataTime] DEFAULT (getdate()) FOR [DataTime]
GO
CREATE TABLE hyoa_SysInfo..t_LockDataNet (
[PID] [int] IDENTITY (1, 1) NOT NULL ,
[TotalNum] [int] NULL ,
[ProList] [varchar] (225) COLLATE Chinese_PRC_CI_AS NULL ,
[DataTime] [datetime] NULL ,
[pFlag] [bit] NULL ,
[NodeName] [varchar] (225) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD CONSTRAINT
PK_t_LockDataNet PRIMARY KEY CLUSTERED
(
PID
) ON [PRIMARY];
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD
CONSTRAINT [DF_t_LockDataNet_TotalNum] DEFAULT (5) FOR [TotalNum],
CONSTRAINT [DF_t_LockDataNet_DataTime] DEFAULT (getdate()) FOR [DataTime]
GO
[PID] [int] IDENTITY (1, 1) NOT NULL ,
[TotalNum] [int] NULL ,
[ProList] [varchar] (225) COLLATE Chinese_PRC_CI_AS NULL ,
[DataTime] [datetime] NULL ,
[pFlag] [bit] NULL ,
[NodeName] [varchar] (225) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD CONSTRAINT
PK_t_LockDataNet PRIMARY KEY CLUSTERED
(
PID
) ON [PRIMARY];
ALTER TABLE hyoa_SysInfo..t_LockDataNet ADD
CONSTRAINT [DF_t_LockDataNet_TotalNum] DEFAULT (5) FOR [TotalNum],
CONSTRAINT [DF_t_LockDataNet_DataTime] DEFAULT (getdate()) FOR [DataTime]
GO
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。