USE [AIS20170114144612]
GO
/****** Object: Table [dbo].[U_PROFORMA] Script Date: 2018/2/26 12:38:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[U_PROFORMA](
[FID] [int] NOT NULL,
[FBillNo] [varchar](30) NULL,
[FDate] [datetime] NULL,
[FText] [varchar](1000) NULL,
[FText1] [varchar](2000) NULL,
[FBase] [int] NULL,
[FText2] [varchar](1000) NULL,
[FText3] [varchar](1000) NULL,
[FDate1] [datetime] NULL,
[FText5] [varchar](1000) NULL,
[FBiller] [int] NULL,
[FUser] [int] NULL,
[FText6] [varchar](1000) NULL,
[FText7] [varchar](1000) NULL,
[FText8] [varchar](1000) NULL,
[FIssue] [int] NULL,
[FZKYY] [varchar](500) NULL,
[FZKJE] [varchar](500) NULL,
[FISYJ] [bit] NULL,
[FNote] [varchar](8000) NULL,
[FJHDate] [datetime] NULL,
[FSettleID] [int] NULL,
[FNoPass] [bit] NOT NULL,
[FNoPassNote] [varchar](5000) NULL,
[FIsEdit] [bit] NOT NULL,
[FPriceType] [varchar](50) NULL,
[FDateChecked] [bit] NOT NULL,
[FDateNoPass] [bit] NOT NULL,
[FDateNoPassNote] [varchar](500) NULL,
[FLastEditTime] [varchar](500) NULL,
[FCurrencyID] [int] NULL,
[FYWCheckerID] [int] NULL,
[FK3InterID] [int] NULL,
[FZLTGDate] [datetime] NULL,
[FJFDate] [datetime] NULL,
[FChecker] [varchar](255) NULL,
[ismultdept] [int] NULL,
[FCWCheckerID] [int] NULL,
[fydg] [int] NULL,
CONSTRAINT [PK_U_PROFORMA] PRIMARY KEY CLUSTERED '添加约束名称,名字为[PK_U_PROFORMA],CLUSTERED 是聚集索引的意思.CLUSTERED | NONCLUSTERED
(
[FID] ASC//FID列升序排列
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FNoPass] DEFAULT ((0)) FOR [FNoPass]
GO
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FIsEdit] DEFAULT ((1)) FOR [FIsEdit]
GO//给FIsEdit添加默认值1
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FDateChecked] DEFAULT ((0)) FOR [FDateChecked]
GO给FDateChecked添加默认值0
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FDateNoPass] DEFAULT ((0)) FOR [FDateNoPass]
GO
GO
/****** Object: Table [dbo].[U_PROFORMA] Script Date: 2018/2/26 12:38:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[U_PROFORMA](
[FID] [int] NOT NULL,
[FBillNo] [varchar](30) NULL,
[FDate] [datetime] NULL,
[FText] [varchar](1000) NULL,
[FText1] [varchar](2000) NULL,
[FBase] [int] NULL,
[FText2] [varchar](1000) NULL,
[FText3] [varchar](1000) NULL,
[FDate1] [datetime] NULL,
[FText5] [varchar](1000) NULL,
[FBiller] [int] NULL,
[FUser] [int] NULL,
[FText6] [varchar](1000) NULL,
[FText7] [varchar](1000) NULL,
[FText8] [varchar](1000) NULL,
[FIssue] [int] NULL,
[FZKYY] [varchar](500) NULL,
[FZKJE] [varchar](500) NULL,
[FISYJ] [bit] NULL,
[FNote] [varchar](8000) NULL,
[FJHDate] [datetime] NULL,
[FSettleID] [int] NULL,
[FNoPass] [bit] NOT NULL,
[FNoPassNote] [varchar](5000) NULL,
[FIsEdit] [bit] NOT NULL,
[FPriceType] [varchar](50) NULL,
[FDateChecked] [bit] NOT NULL,
[FDateNoPass] [bit] NOT NULL,
[FDateNoPassNote] [varchar](500) NULL,
[FLastEditTime] [varchar](500) NULL,
[FCurrencyID] [int] NULL,
[FYWCheckerID] [int] NULL,
[FK3InterID] [int] NULL,
[FZLTGDate] [datetime] NULL,
[FJFDate] [datetime] NULL,
[FChecker] [varchar](255) NULL,
[ismultdept] [int] NULL,
[FCWCheckerID] [int] NULL,
[fydg] [int] NULL,
CONSTRAINT [PK_U_PROFORMA] PRIMARY KEY CLUSTERED '添加约束名称,名字为[PK_U_PROFORMA],CLUSTERED 是聚集索引的意思.CLUSTERED | NONCLUSTERED
(
[FID] ASC//FID列升序排列
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
①pad_index:指定索引中间级中每个页(节点)上保持开放的空间。PAD_INDEX 选项只有在指定了 FILLFACTOR 时才有用,因为 PAD_INDEX 使用由 FILLFACTOR 所指定的百分比。默认情况下,给定中间级页上的键集,SQL Server 将确保每个索引页上的可用空间至少可以容纳一个索引允许的最大行。如果为 FILLFACTOR 指定的百分比不够大,无法容纳一行,SQL Server 将在内部使用允许的最小值替代该百分比。
②ignore_dup_key=off:如果有一行或多行含有重复键值,则 SQL Server 数据库引擎 将拒绝语句操作的所有行。
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FNoPass] DEFAULT ((0)) FOR [FNoPass]
GO
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FIsEdit] DEFAULT ((1)) FOR [FIsEdit]
GO//给FIsEdit添加默认值1
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FDateChecked] DEFAULT ((0)) FOR [FDateChecked]
GO给FDateChecked添加默认值0
ALTER TABLE [dbo].[U_PROFORMA] ADD CONSTRAINT [DF_U_PROFORMA_FDateNoPass] DEFAULT ((0)) FOR [FDateNoPass]
GO