12-22-09, 14:44 #1Registered User
- Join Date
- Apr 2002
- Sunnyvale, CA USA
Unanswered: Moving a heap to a Partition Function
I have a table in the PRIMARY filegroup which doesn't have any PK, indexes, or constraints defined.
I want to change it to use a date-based Partition Function, and I'll probably add a clustered PK at the same time.
However, the only command I can find to change the table storage information is:-
ALTER TABLE TAB1
DROP CONSTRAINT PK_TAB1
WITH (MOVE TO DatePScheme(mydatefield))
Unfortunately the current table doesn't have a constraint to drop!
Do I really have to create a constraint just so I can drop it?
12-22-09, 15:20 #2Annie's Dog Walker
Provided Answers: 6
- Join Date
- Nov 2004
- on the wrong server
add the primary using ADD CONSTRAINT and specify the filegroup you want to move to.If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry. Earnest Hemingway, A Farewell To Arms.