SQL语句新建表,同时添加主键、索引、约束

SQL语句新建表,同时添加主键、索引、约束

2023年7月13日发(作者:)

SQL语句新建表,同时添加主键、索引、约束SQL语句新建数据表 主键,索引,约束CREATE TABLE [dbo].[T_SendInsideMessageRec]( [SendInsideMID] [uniqueidentifier] NOT NULL, [ReceiveMobile] [nvarchar](20) NULL, [SendTime] [datetime] NULL, [Content] [nvarchar](200) NULL, [result] [nvarchar](100) NULL, [remark] [nvarchar](100) NOT NULL, CONSTRAINT [PK_T_SendInsideMessageRec] PRIMARY KEY NONCLUSTERED

( [SendInsideMID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_SendInsideMID] DEFAULT (newid()) FOR [SendInsideMID]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_ReceiveMobile] DEFAULT ('') FOR [ReceiveMobile]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_SendTime] DEFAULT (getdate()) FOR [SendTime]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_Content] DEFAULT ('') FOR [Content]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_result] DEFAULT ('') FOR [result]GOALTER TABLE [dbo].[T_SendInsideMessageRec] ADD CONSTRAINT [DF_T_SendInsideMessageRec_remark] DEFAULT ('') FOR [remark]GO

发布者:admin,转转请注明出处:http://www.yc00.com/web/1689244086a225530.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信