I have a large group of tables with related PKs and FKs but it's not a simple copy all and change the FK to the new PK.Employees,Departments,Locations, etc have FK to Company PKEmployeeDepartments,EmployeeLocations have FK to Employee and FK to Departments,Locations
This is a small set of the ~80 tables that are linked in some way. Is there an easy way, in SQL or T-SQL, to copy all the information and assign new PKs and update the new FKs? I'd prefer not to have to manually code a function to do this as tables add/change frequently with development progressing (I'd have to keep updating it to keep up with table changes).Thanks,Traigo