Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2005
    Posts
    319

    Unanswered: SWITCH-ing partitions and foreign keys

    We have a daily purge job that runs on 4 tables that switches out the oldest partition into an archive table and then truncates the contents.

    Problem we ran into was a deadlock occurred when the FK's were attempted to be dropped. I realize making schema changes is not ideal for any DB Maintenance procedures, has anyone else run into something similar and came up with a fix to preserve referential integrity? The referring table is one of the 4 tables in which we are performing the SWITCH on.

  2. #2
    Join Date
    Jun 2005
    Posts
    319
    No foreign key from another table can reference the source table. The source table cannot be referenced by a foreign key in another table.
    from:
    Transferring Data Efficiently by Using Partition Switching

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •