Use code below to create a foreign key on an existing table in SQL Server
ALTER TABLE Table1
ADD FOREIGN KEY (Column_Name) REFERENCES Table2(Column_Name)
Use code below to create a foreign key on an existing table - SQL Server:
ALTER TABLE Table1
ADD FOREIGN KEY (Column_Name) REFERENCES Table2(Column_Name)