I assume that you want to replace JakMasterId with an auto-increment field so that there are no varchar (60) fields in the other two tables and to improve query time, but you keep JakMasterId as information.
-- set database single-user -- drop foreign keys create table NewMaster (ID int identity(1, 1), JakMasterId, Date)) insert NewMaster(JakMasterId, Date) select JakMasterId, Date from JakMaster drop table JakMaster sp_rename 'NewMaster', 'JakMaster' alter table JakToRoad add MasterId int alter table JakToBig add MasterId int update JakToRoad set MasterId = JakMaster.ID from JakToRoad inner join JakMaster on JakMaster.JakMasterId = JakToRoad.JakMasterId update JakToBig set MasterId = JakMaster.ID from JakToBig inner join JakMaster on JakMaster.JakMasterId = JakToBig .JakMasterId alter table JakToRoad drop column JakMasterId alter table JakToBig drop column JakMasterId alter table JakToRoad add constraint FK_JTRtoJM foreign key (MasterId) references JakMaster (ID) alter table JakToBig add constraint FK_JTBtoJM foreign key (MasterId) references JakMaster (ID) -- reset database to multi-user
source share