
IF EXISTS
(
    SELECT * FROM INFORMATION_SCHEMA.COLUMNS 
		WHERE TABLE_NAME = 'EST_PED_CP' AND COLUMN_NAME = 'UUID'
		AND DATA_TYPE = 'varchar'
)
BEGIN

	ALTER TABLE dbo.EST_PED_CP DROP CONSTRAINT DF_EST_PED_CP_UUID ;	
	ALTER TABLE dbo.EST_PED_CP ALTER COLUMN UUID uniqueidentifier  NULL;
	ALTER TABLE dbo.EST_PED_CP ADD CONSTRAINT
		DF_EST_PED_CP_UUID DEFAULT NEWID() FOR UUID;
END
go

IF NOT EXISTS
(
    SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'EST_PED_CP' AND COLUMN_NAME = 'UUID'
)
BEGIN
	ALTER TABLE dbo.EST_PED_CP ADD
		UUID uniqueidentifier  NULL;

	ALTER TABLE dbo.EST_PED_CP ADD CONSTRAINT
		DF_EST_PED_CP_UUID DEFAULT NEWID() FOR UUID;
END