IF EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='LD0P0ARCHIVEINTERACTIONLOG')
BEGIN
DROP TABLE LD0P0ARCHIVEINTERACTIONLOG
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0ARCHIVEINTERACTIONLOG')
BEGIN
DROP VIEW LD0V0ARCHIVEINTERACTIONLOG
END
;
CREATE TABLE LD0P0ARCHIVEINTERACTIONLOG
(
ID int IDENTITY(1,1) NOT NULL,
QUEUEID int NOT NULL,
DOCUMENTGROUP int NOT NULL,
ARCHIVEACTION int NOT NULL,
DOCUMENTID int NOT NULL,
MESSAGEOID varchar(100) NULL,
ARCHDATE datetime NOT NULL,
ISSUCCESS int NOT NULL,
ERRORMESSAGE varchar(250) NULL,
CONSTRAINT LD0P0ARCHIVEINTERACTIONLOG_PKID PRIMARY KEY CLUSTERED
(
ID ASC
)
)
;
CREATE VIEW LD0V0ARCHIVEINTERACTIONLOG AS SELECT * FROM LD0P0ARCHIVEINTERACTIONLOG
;