--creazione campi IDCliente in ScontrinoT

IF NOT EXISTS (select * from Information_SCHEMA.columns where Table_name='ScontrinoT' and column_name='IDCliente')
ALTER TABLE dbo.ScontrinoT ADD
	IDCliente int NULL
GO

IF NOT EXISTS (select * from Information_SCHEMA.table_constraints where Table_name='ScontrinoT' and constraint_name='FK_ScontrinoT_Cliente ')
ALTER TABLE dbo.ScontrinoT ADD CONSTRAINT
	FK_ScontrinoT_Cliente FOREIGN KEY
	(
	IDCliente
	) REFERENCES dbo.Cliente
	(
	IDCliente
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
	
GO

