Drop index .......with (Move To [Data Partition Scheme] (.....))

I hope there is only one method to create partition on nonempty table (pls share any there is any other method for same) :

Drop index .......with (Move To [Data Partition Scheme] (.....))

Does this commond drop the actual index? if yes, can i create similar index on the table?

more ▼

asked Feb 22, 2010 at 07:51 AM in Default

kardile gravatar image

301 14 14 14

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

That command doesn't create a partition - it would remove any partitions created by the index being dropped. To create a partition (or, more accurately, an index over a series of partitons) you would use CREATE INDEX and specify a partition scheme as the destination data space:

CREATE INDEX [myPartitionedIndex]
ON [myTable] ([column])
ON [myPartitionScheme] ([partitoning_column])

In answer to your other questions, yes - the index is actually dropped and yes, you can then create a similar index.

more ▼

answered Feb 22, 2010 at 08:05 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.5k 61 65 87

Thanks Matt,

what is a difference between
CREATE TABLE......on [myPartitionScheme] ([partitoning_column] and CREATE INDEX......on [myPartitionScheme] ([partitoning_column] ? Which one is preferred & why?
Feb 22, 2010 at 10:01 AM kardile
When you specify ON in CREATE TABLE, it's either specifying where the heap goes (if you don't specify a clustered constraint) or it's actually doing nothing at all (if you do specify a clustered constraint). When you specify it on create index, you're specifying where that index will be stored, whether clustered or not.
Feb 22, 2010 at 10:46 AM Matt Whitfield ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Feb 22, 2010 at 07:51 AM

Seen: 2335 times

Last Updated: Feb 22, 2010 at 08:25 AM