79674490

Date: 2025-06-21 14:10:23
Score: 1
Natty:
Report link

Nice work solving it by disabling constraints and triggers — I’ve dealt with similar FK-related copy issues before and know how frustrating it can get.

Just to add another option for similar situations:

I’ve built a tool for SQL Server that copies related data between tables within the same database — keeping foreign key relationships intact and remapping identity values where needed.

It’s useful when:

- You need to duplicate rows across related tables (e.g. copy an order with its items and comments)

- Foreign keys must be preserved correctly

- The insert order must follow dependency rules automatically

- You want to apply filters or dry-run first

- You prefer not to disable constraints or write custom scripts

It doesn’t handle cross-database migration, but for deep-copy scenarios inside one database, it can save a lot of time.

If anyone’s interested in testing it or giving feedback, I’d be happy to share it privately.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Kostas Dalas