Get the proper structure for this table from the TWO
sourcdoc char(11) not null
after aacopystatus
---------------------------------------------------
GO
ALTER TABLE [dbo].[AAG30001] DROP CONSTRAINT [CK__AAG30001__aaChan__3B9CC307]
GO
ALTER TABLE [dbo].[AAG30001] DROP CONSTRAINT [CK__AAG30001__aaChan__3AA89ECE]
GO
ALTER TABLE [dbo].[AAG30001] DROP CONSTRAINT [CK__AAG30001__TIME1__39B47A95]
GO
ALTER TABLE [dbo].[AAG30001] DROP CONSTRAINT [CK__AAG30001__EXCHDA__38C0565C]
GO
/****** Object: Table [dbo].[AAG30001] Script Date: 9/29/2015 2:43:50 AM ******/
DROP TABLE [dbo].[AAG30001]
GO
/****** Object: Table [dbo].[AAG30001] Script Date: 9/29/2015 2:43:50 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AAG30001](
[aaGLHdrID] [int] NOT NULL,
[aaGLDistID] [int] NOT NULL,
[INTERID] [char](5) NOT NULL,
[CorrespondingUnit] [char](5) NOT NULL,
[ACTINDX] [int] NOT NULL,
[ACCTTYPE] [smallint] NOT NULL,
[aaBrowseType] [smallint] NOT NULL,
[DECPLACS] [smallint] NOT NULL,
[DEBITAMT] [numeric](19, 5) NOT NULL,
[CRDTAMNT] [numeric](19, 5) NOT NULL,
[ORDBTAMT] [numeric](19, 5) NOT NULL,
[ORCRDAMT] [numeric](19, 5) NOT NULL,
[CURNCYID] [char](15) NOT NULL,
[CURRNIDX] [smallint] NOT NULL,
[RATETPID] [char](15) NOT NULL,
[EXGTBLID] [char](15) NOT NULL,
[XCHGRATE] [numeric](19, 7) NOT NULL,
[EXCHDATE] [datetime] NOT NULL,
[TIME1] [datetime] NOT NULL,
[RTCLCMTD] [smallint] NOT NULL,
[DENXRATE] [numeric](19, 7) NOT NULL,
[MCTRXSTT] [smallint] NOT NULL,
[SEQNUMBR] [int] NOT NULL,
[aaCustID] [int] NOT NULL,
[aaVendID] [int] NOT NULL,
[aaSiteID] [int] NOT NULL,
[aaItemID] [int] NOT NULL,
[aaCopyStatus] [smallint] NOT NULL,
[SOURCDOC] [char](11) NULL,
[aaChangeDate] [datetime] NOT NULL,
[aaChangeTime] [datetime] NOT NULL,
[DEX_ROW_ID] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [PKAAG30001] PRIMARY KEY CLUSTERED
(
[aaGLHdrID] ASC,
[aaGLDistID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[AAG30001] WITH CHECK ADD CONSTRAINT [CK__AAG30001__EXCHDA__38C0565C] CHECK ((datepart(hour,[EXCHDATE])=(0) AND datepart(minute,[EXCHDATE])=(0) AND datepart(second,[EXCHDATE])=(0) AND datepart(millisecond,[EXCHDATE])=(0)))
GO
ALTER TABLE [dbo].[AAG30001] CHECK CONSTRAINT [CK__AAG30001__EXCHDA__38C0565C]
GO
ALTER TABLE [dbo].[AAG30001] WITH CHECK ADD CONSTRAINT [CK__AAG30001__TIME1__39B47A95] CHECK ((datepart(day,[TIME1])=(1) AND datepart(month,[TIME1])=(1) AND datepart(year,[TIME1])=(1900)))
GO
ALTER TABLE [dbo].[AAG30001] CHECK CONSTRAINT [CK__AAG30001__TIME1__39B47A95]
GO
ALTER TABLE [dbo].[AAG30001] WITH CHECK ADD CONSTRAINT [CK__AAG30001__aaChan__3AA89ECE] CHECK ((datepart(hour,[aaChangeDate])=(0) AND datepart(minute,[aaChangeDate])=(0) AND datepart(second,[aaChangeDate])=(0) AND datepart(millisecond,[aaChangeDate])=(0)))
GO
ALTER TABLE [dbo].[AAG30001] CHECK CONSTRAINT [CK__AAG30001__aaChan__3AA89ECE]
GO
ALTER TABLE [dbo].[AAG30001] WITH CHECK ADD CONSTRAINT [CK__AAG30001__aaChan__3B9CC307] CHECK ((datepart(day,[aaChangeTime])=(1) AND datepart(month,[aaChangeTime])=(1) AND datepart(year,[aaChangeTime])=(1900)))
GO
ALTER TABLE [dbo].[AAG30001] CHECK CONSTRAINT [CK__AAG30001__aaChan__3B9CC307]
GO
No comments:
Post a Comment