IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'SOURCE'
          AND Object_ID = Object_ID(N'LD0P0DOCUMENTQUEUE'))
BEGIN
ALTER TABLE LD0P0DOCUMENTQUEUE
	ADD SOURCE VARCHAR(100) NULL
END
;
IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'KANTAPHASE'
          AND Object_ID = Object_ID(N'LD0P0DOCUMENTQUEUE'))
BEGIN
ALTER TABLE LD0P0DOCUMENTQUEUE
	ADD KANTAPHASE INT NULL
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0DOCUMENTQUEUE')
BEGIN
DROP VIEW LD0V0DOCUMENTQUEUE 
END
;
CREATE VIEW LD0V0DOCUMENTQUEUE AS
	SELECT * FROM LD0P0DOCUMENTQUEUE
;