IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'recibo') AND COL_LENGTH('[dbo].[recibo]', 'tipopagamento') IS NOT NULL AND COL_LENGTH('[dbo].[recibo]', 'IdTipoRecibo') IS NOT NULL
BEGIN
 UPDATE [dbo].[recibo] SET IdTipoRecibo = CASE WHEN(tipopagamento = 'PAGAMENTO') THEN 0 ELSE 1 END;
END