Is it possible in a single statement to switch ALL partitions from one partitioned table to a staging table?
Tell me more
×
Database Administrators Stack Exchange is a question and answer site for
database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.
|
migrated from stackoverflow.com Oct 17 '11 at 16:06
|
For anyone wanting a solution to this, here's a sproc I cooked up:
|
|||
|
|
No. I don't believe this is possible. The staging table must have a constraint on it that matches a specific partition and The closest you could do to this is to write something that iterated over the partition ranges and swapped the table to a temp table and then into another partitioned table. |
|||
|
|