June 26, 2009 at 2:21 am
We use a similar script and recently partitiond a database. Now I receive a syntaxerror on this statement:
ALTER INDEX [MUTA_PI3]
ON [prd_00rpd_hrm].[hrm].[MUTA]
REBUILD
WITH
(ONLINE = ON,
FILLFACTOR = 90,
MAXDOP = 0)
PARTITION = 2;
error: Msg 102, Level 15, State 1, Line 8
Incorrect syntax near 'PARTITION'.
I can't figure out what the correct syntax is. Leaving out the PARTITION statement works, leaving out the WITH statement works. I can't find an example combining the 2.
Help please?
Greetz,
Hans Brouwer
June 26, 2009 at 4:31 am
ALTER INDEX [MUTA_PI3]
ON [prd_00rpd_hrm].[hrm].[MUTA]
REBUILD
WITH
(ONLINE = ON,
FILLFACTOR = 90,
MAXDOP = 0)
PARTITION = 2;
error: Msg 102, Level 15, State 1, Line 8
Incorrect syntax near 'PARTITION'.
Try this..
ALTER INDEX [MUTA_PI3]
ON [prd_00rpd_hrm].[hrm].[MUTA]
REBUILD PARTITION = 2
WITH
(ONLINE = ON,
FILLFACTOR = 90,
MAXDOP = 0)
June 26, 2009 at 5:39 am
PS,
This is a solution I had tried first.
Don't get me wrong, but have you checked this in SSMS? I don't think so...
BTW, I have found the problem. Some options don't work with the PARTITION option.
Greetz,
Hans Brouwer
June 26, 2009 at 7:14 am
According to MSDN specification....
ALTER INDEX cannot be used to repartition an index or move it to a different filegroup. This statement cannot be used to modify the index definition, such as adding or deleting columns or changing the column order. Use CREATE INDEX with the DROP_EXISTING clause to perform these operations.
June 26, 2009 at 7:18 am
FreeHansje (6/26/2009)
PS,This is a solution I had tried first.
Don't get me wrong, but have you checked this in SSMS? I don't think so...
BTW, I have found the problem. Some options don't work with the PARTITION option.
I didnt try that. I studies technet for that. there were two options, one that i/u mentioned. Other one required one to create a partition function/schema and then create the index.. will again search for those links and post them 🙂
June 26, 2009 at 7:29 am
Hey guys,
'Pandian S' posted what I believe is the correct answer...in case you missed it in all the excitement there 😉
Paul
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply