
---- Tabella IVA - CAMPO AttivaBollo ---

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'IVA'
AND syscolumns.name = 'AttivaBollo')
BEGIN 
ALTER TABLE dbo.IVA ADD
	AttivaBollo Bit NOT NULL CONSTRAINT DF_IVA_AttivaBollo DEFAULT ((0))
END


---- Tabella TipiDocumento CAMPO BolloDefault ---

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'TipiDocumento'
AND syscolumns.name = 'BolloDefault')
BEGIN 
ALTER TABLE dbo.TipiDocumento ADD
	BolloDefault decimal(18, 2) NOT NULL CONSTRAINT DF_TipiDocumento_BolloDefault DEFAULT ((0))
END



---- Tabella TipiDocumento CAMPO BolloNonConteggiato ---

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'TipiDocumento'
AND syscolumns.name = 'BolloNonConteggiato')
BEGIN 
ALTER TABLE dbo.TipiDocumento ADD
	BolloNonConteggiato Bit NOT NULL CONSTRAINT DF_TipiDocumento_BolloNonConteggiato DEFAULT ((0))
END

---- Tabella Documenti CAMPO BolloDefault ---

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'Documenti'
AND syscolumns.name = 'Bolli')
BEGIN 
ALTER TABLE dbo.TipiDocumento ADD
	Bolli decimal(18, 2) NOT NULL CONSTRAINT DF_Documenti_Bolli DEFAULT ((0))
END



---- Tabella Documenti CAMPO BolloNonConteggiato ---

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'Documenti'
AND syscolumns.name = 'BolloNonConteggiato')
BEGIN 
ALTER TABLE dbo.Documenti ADD
	BolloNonConteggiato Bit NOT NULL CONSTRAINT DF_Documenti_BolloNonConteggiato DEFAULT ((0))
END