IF COL_LENGTH('Clientes_Invitados_Mov', 'Id_Link') IS NULL 
	ALTER TABLE Clientes_Invitados_Mov ADD Id_Link INT
GO

IF EXISTS (SELECT * FROM sysobjects WHERE Name='Clientes_Invitados_Mov' AND xtype='U')
	AND NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'FOREIGN KEY' 
	AND CONSTRAINT_NAME = 'FK_CliIM_Links')
BEGIN
	ALTER TABLE Clientes_Invitados_Mov  ADD CONSTRAINT FK_CliIM_Links FOREIGN KEY(Id_Link)
	REFERENCES Clientes_Links (Id_Link)
END
GO