﻿IF (EXISTS ( SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'ToleranciaPremio' AND TABLE_NAME = 'ciaseg') 
AND EXISTS ( SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'ToleranciaPremio' AND DATA_TYPE = 'nvarchar' AND TABLE_NAME = 'ciaseg')) 
BEGIN
	UPDATE ciaseg SET ToleranciaPremio = NULL;
	ALTER TABLE ciaseg ALTER COLUMN ToleranciaPremio numeric(8,2) NULL;
END