Skip to Content
0

How do I unpartion a table partioned by hash ?

Jul 05, 2017 at 03:38 PM

47

avatar image

How do I unpartion a table partioned by hash ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Bret Halford
Jul 05, 2017 at 05:28 PM
1

ALTER TABLE UNPARTITION can only be applied to tables that are partitioned by roundrobin.

It seems a little silly, but the way to do it is to first modify the hash-partitioned table to roundrobin partitioning, then use the unpartition option:

1> alter table mysalesdetail unpartition
2> go
Msg 13964, Level 16, State 1:
Server 'DENN00641548A', Line 1:
ALTER TABLE 'mysalesdetail' failed. Unpartition operation is only permitted on
roundrobin partitioned tables. Table is partitioned by hash. Use the ALTER TABLE
... PARTITION BY command to create an unpartitioned table. This will involve
data relocation.

1> alter table mysalesdetail partition by roundrobin 3
2> go
(0 rows affected)
1> alter table mysalesdetail unpartition
2> go

The table is now unpartitioned.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the sanity check ...

0