if exists (select 1 from syscolumns 
inner join systypes on syscolumns.xtype = systypes.xtype
where id = object_id('RC_CONC_PDV_VD_TEF') and syscolumns.name = 'NR_NSU' and systypes.name like 'MONEY')
begin
	EXEC sp_rename 'RC_CONC_PDV_VD_TEF.NR_NSU', 'NR_NSU_MONEY', 'COLUMN';
	ALTER TABLE dbo.RC_CONC_PDV_VD_TEF DROP CONSTRAINT DF_RC_CONC_PDV_VD_TEF_NR_NSU
end

if not exists(select 1 from syscolumns where id = object_id('RC_CONC_PDV_VD_TEF') and name = 'NR_NSU')
BEGIN
	ALTER TABLE dbo.RC_CONC_PDV_VD_TEF ADD
		NR_NSU VARCHAR(50) NULL
	ALTER TABLE dbo.RC_CONC_PDV_VD_TEF ADD CONSTRAINT
		DF_RC_CONC_PDV_VD_TEF_NR_NSU DEFAULT '' FOR NR_NSU
END	
GO
UPDATE
	RC_CONC_PDV_VD_TEF
SET 
	NR_NSU = convert(bigint,NR_NSU_MONEY)
WHERE
	(NR_NSU <> NR_NSU_MONEY OR NR_NSU IS NULL)
