
---- Tabella Configurazione Importazione prodotti

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'QtaFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	QtaFisso varchar(5) NOT NULL CONSTRAINT DF_SetfileFornitori_QtaFisso DEFAULT ''
END


IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'PrezzoVenditaFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	PrezzoVenditaFisso varchar(50) NOT NULL CONSTRAINT DF_SetfileFornitori_PrezzoVenditaFisso DEFAULT ''
END


--- IvaFisso

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'IvaFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	IvaFisso varchar(50) NOT NULL CONSTRAINT DF_SetfileFornitori_IvaFisso DEFAULT ''
END


--- PrezzoAcquistoFisso

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'PrezzoAcquistoFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	PrezzoAcquistoFisso varchar(50) NOT NULL CONSTRAINT DF_SetfileFornitori_PrezzoAcquistoFisso DEFAULT ''
END
--- UMFisso

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'UMFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	UMFisso varchar(50) NOT NULL CONSTRAINT DF_SetfileFornitori_UMFisso DEFAULT ''
END

--- TipologiaFisso

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'TipologiaFisso')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	TipologiaFisso varchar(50) NOT NULL CONSTRAINT DF_SetfileFornitori_TipologiaFisso DEFAULT ''
END

--- descr_Attivo

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'descr_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	descr_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_descr_Attivo DEFAULT 0
END

--- qta_Attivo 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'qta_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	qta_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_qta_Attivo DEFAULT 0
END

--- prezzo_Attivo 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'prezzo_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	prezzo_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_prezzo_Attivo DEFAULT 0
END

--- iva_Attivo --- 


IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'iva_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	iva_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_iva_Attivo DEFAULT ''
END

--- barcode_Attivo 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'barcode_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	barcode_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_barcode_Attivo DEFAULT 0
END


--- prezzoAcq_Attivo

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'prezzoAcq_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	prezzoAcq_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_prezzoAcq_Attivo DEFAULT 0
END


--- um_Attivo

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'um_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	um_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_um_Attivo DEFAULT 0
END


--- tipologia_Attivo 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'tipologia_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	tipologia_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_tipologia_Attivo DEFAULT 0
END

--- codfor_Attivo, 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'codfor_Attivo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	codfor_Attivo INT NOT NULL CONSTRAINT DF_SetfileFornitori_codfor_Attivo DEFAULT 0
END

--- descr_Index 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'descr_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	descr_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_descr_Index DEFAULT 0
END

--- qta_Index 

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'qta_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	qta_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_qta_Index DEFAULT 0
END

--- prezzo_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'prezzo_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	prezzo_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_prezzo_Index DEFAULT 0
END

--- iva_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'iva_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	iva_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_iva_Index DEFAULT 0
END

--- barcode_Indexprezzo

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'barcode_Indexprezzo')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	barcode_Indexprezzo INT NOT NULL CONSTRAINT DF_SetfileFornitori_barcode_Indexprezzo DEFAULT 0
END


--- barcode_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'barcode_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	barcode_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_barcode_Index DEFAULT 0
END

--- Acq_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'Acq_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	Acq_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_Acq_Index DEFAULT 0
END

--- prezzoAcq_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'prezzoAcq_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	prezzoAcq_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_prezzoAcq_Index DEFAULT 0
END

--- um_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'um_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	um_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_um_Index DEFAULT 0
END

--- tipologia_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'tipologia_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	tipologia_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_tipologia_Index DEFAULT 0
END

--- codfor_Index

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'codfor_Index')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	codfor_Index INT NOT NULL CONSTRAINT DF_SetfileFornitori_codfor_Index DEFAULT 0
END

--- InizioRigaFile

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'InizioRigaFile')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	InizioRigaFile INT NOT NULL CONSTRAINT DF_SetfileFornitori_InizioRigaFile DEFAULT 0
END

--- PercoroCartella

IF NOT EXISTS(SELECT 1
FROM sysobjects,
syscolumns
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 'SetfileFornitori'
AND syscolumns.name = 'PercoroCartella')
BEGIN 
ALTER TABLE dbo.SetfileFornitori ADD
	PercoroCartella varchar(MAX) NOT NULL CONSTRAINT DF_SetfileFornitori_PercoroCartella DEFAULT ''
END