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

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

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

	ALTER TABLE dbo.EST_PED_VD ADD CONSTRAINT
		DF_EST_PED_VD_UUID DEFAULT NEWID() FOR UUID;
END