if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_cat_posicion_id_catalogo_equipo_componente')
begin
 ALTER TABLE [cat_posicion] ADD CONSTRAINT
	FK_cat_posicion_id_catalogo_equipo_componente FOREIGN KEY
	([id_catalogo.equipo_componente]) REFERENCES [cat_catalogo.equipo]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_cat_posicion_id_catalogo_equipo_equipo')
begin
 ALTER TABLE [cat_posicion] ADD CONSTRAINT
	FK_cat_posicion_id_catalogo_equipo_equipo FOREIGN KEY
	([id_catalogo.equipo_equipo]) REFERENCES [cat_catalogo.equipo]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_cat_posicion_id_dimension_x')
begin
 ALTER TABLE [cat_posicion] ADD CONSTRAINT
	FK_cat_posicion_id_dimension_x FOREIGN KEY
	([id_dimension_x]) REFERENCES [cat_dimension]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_cat_posicion_id_dimension_y')
begin
 ALTER TABLE [cat_posicion] ADD CONSTRAINT
	FK_cat_posicion_id_dimension_y FOREIGN KEY
	([id_dimension_y]) REFERENCES [cat_dimension]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_cat_posicion_id_dimension_z')
begin
 ALTER TABLE [cat_posicion] ADD CONSTRAINT
	FK_cat_posicion_id_dimension_z FOREIGN KEY
	([id_dimension_z]) REFERENCES [cat_dimension]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO

if not exists (select * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS where CONSTRAINT_NAME= 'FK_equ_trazabilidad_id_posicion')
begin
 ALTER TABLE [equ_trazabilidad] ADD CONSTRAINT
	FK_equ_trazabilidad_id_posicion FOREIGN KEY
	([id_posicion]) REFERENCES [cat_posicion]
	(id) ON UPDATE  NO ACTION ON DELETE  NO ACTION 
end
GO
