IF EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='LD0P0EXTERNALPERSONIDS')
BEGIN
EXEC SP_RENAME 'LD0P0EXTERNALPERSONIDS', 'LD0P0PERSONEXTERNALIDS'
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0EXTERNALPERSONIDS')
BEGIN
DROP VIEW LD0V0EXTERNALPERSONIDS
END
;
IF EXISTS (SELECT 1 FROM SYS.VIEWS WHERE NAME='LD0V0PERSONEXTERNALIDS')
BEGIN
DROP VIEW LD0V0PERSONEXTERNALIDS
END
;
CREATE VIEW LD0V0PERSONEXTERNALIDS
	AS SELECT * FROM LD0P0PERSONEXTERNALIDS
;