IF COL_LENGTH('Valores_Tarjetas_Cred', 'Id_Cta_Banco') IS NULL 
	ALTER TABLE Valores_Tarjetas_Cred ADD Id_Cta_Banco SMALLINT
GO

IF EXISTS (SELECT * FROM sysobjects WHERE Name='Valores_Tarjetas_Cred' AND xtype='U')
	AND NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'FOREIGN KEY' 
	AND CONSTRAINT_NAME = 'FK_Val_Tar_Cta_Bco')
BEGIN
	ALTER TABLE Valores_Tarjetas_Cred  ADD CONSTRAINT FK_Val_Tar_Cta_Bco FOREIGN KEY (Id_Cta_Banco)
	REFERENCES Bancos_Ctas (Id_Cta_Banco)
END
GO