1 -- 这是依据系统自动生成的create脚本,填入所需字段来创建表 2 3 USE [csnprod] 4 GO 5 6 /****** Object: Table [dbo].[message_master] Script Date: 2023/8/25 12:57:06 ******/ 7 SET ANSI_NULLS ON 8 GO 9 10 SET QUOTED_IDENTIFIER ON 11 GO 12 13 SET ANSI_PADDING ON 14 GO 15 -- 创建主表:主键、所需字段、创建人和修改人 16 CREATE TABLE [dbo].[mes_master]( 17 [mes_id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, 18 19 [mes_title] [varchar](50) NOT NULL, 20 [mes_grade] [varchar](20) NOT NULL, 21 22 [create_user] [varchar](20) NOT NULL, 23 [create_time] [datetime] NOT NULL, 24 25 [trans_user] [varchar](20) NOT NULL, 26 [trans_time] [datetime] NOT NULL, 27 CONSTRAINT [PK_mes_master] PRIMARY KEY CLUSTERED 28 ( 29 [mes_id] ASC 30 )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 31 ) ON [PRIMARY] 32 33 GO 34 --------------------------------------------------------------------------------------------- 35 --------------------------------------------------------------------------------------------- 36 SET ANSI_PADDING OFF 37 GO 38 39 -- 明细表:有自己的主键、与主表有同名关联字段、所需字段、创建人和修改人 40 CREATE TABLE [dbo].[mes_details]( 41 [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, 42 43 [mes_id] [numeric](18, 0) NOT NULL, 44 45 [mes_notifier] [varchar](50) NOT NULL, 46 [noti_department] [varchar](20) NOT NULL, 47 48 [create_user] [varchar](20) NOT NULL, 49 [create_time] [datetime] NOT NULL, 50 51 [trans_user] [varchar](20) NOT NULL, 52 [trans_time] [datetime] NOT NULL, 53 CONSTRAINT [PK_mes_details] PRIMARY KEY CLUSTERED 54 ( 55 [id] ASC 56 )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 57 ) ON [PRIMARY] 58 59 GO 60 61 SET ANSI_PADDING OFF 62 GO
标签:20,OFF,create,Server,mes,sql,GO,varchar,NULL From: https://www.cnblogs.com/mengweilong/p/17658346.html