declare @sql varchar(1000) 
SET @sql = 'ALTER TABLE [dbo].[history] DROP CONSTRAINT '+(SELECT top 1 name FROM sysobjects where name LIKE 'DF__history__invStat%')
exec(@sql)
GO

ALTER TABLE history ALTER COLUMN invStatus tinyint NULL

GO

ALTER TABLE documents ALTER COLUMN seria varchar (25) COLLATE SQL_Latin1_General_CP1251_CI_AS NULL

GO

UPDATE history SET invStatus=NULL WHERE invStatus=0


