IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'HAND'
          AND Object_ID = Object_ID(N'LD0P0LOG'))
BEGIN
ALTER TABLE LD0P0LOG 
	ADD HAND VARCHAR(10)
	CONSTRAINT LD0P0LOG_HAND DEFAULT ' ' NOT NULL
END
;
IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'MEDHAND'
          AND Object_ID = Object_ID(N'LD0P0LOG'))
BEGIN
ALTER TABLE LD0P0LOG 
	ADD MEDHAND VARCHAR(10)
	CONSTRAINT LD0P0LOG_MEDHAND DEFAULT ' ' NOT NULL
END
;
IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'ANVHAND'
          AND Object_ID = Object_ID(N'LD0P0LOG'))
BEGIN
ALTER TABLE LD0P0LOG 
	ADD ANVHAND VARCHAR(10)
	CONSTRAINT LD0P0LOG_ANVHAND DEFAULT ' ' NOT NULL
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='PCCV0LOG')
BEGIN
DROP VIEW PCCV0LOG
END
;
CREATE VIEW PCCV0LOG AS
	SELECT * FROM LD0P0LOG
;

IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'HAND'
          AND Object_ID = Object_ID(N'LD0P0ARC'))
BEGIN
ALTER TABLE LD0P0ARC 
	ADD HAND VARCHAR(10)
	CONSTRAINT LD0P0ARC_HAND DEFAULT ' ' NOT NULL
END
;
IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'MEDHAND'
          AND Object_ID = Object_ID(N'LD0P0ARC'))
BEGIN
ALTER TABLE LD0P0ARC 
	ADD MEDHAND VARCHAR(10)
	CONSTRAINT LD0P0ARC_MEDHAND DEFAULT ' ' NOT NULL
END
;
IF NOT EXISTS(SELECT 1 FROM sys.columns 
          WHERE Name = N'ANVHAND'
          AND Object_ID = Object_ID(N'LD0P0ARC'))
BEGIN
ALTER TABLE LD0P0ARC 
	ADD ANVHAND VARCHAR(10)
	CONSTRAINT LD0P0ARC_ANVHAND DEFAULT ' ' NOT NULL
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='PCCV0ARC')
BEGIN
DROP VIEW PCCV0ARC 
END
;
CREATE VIEW PCCV0ARC AS
	SELECT * FROM LD0P0ARC
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0ARC')
BEGIN
DROP VIEW LD0V0ARC 
END
;
CREATE VIEW LD0V0ARC AS
	SELECT * FROM LD0P0ARC
;