November 22, 2010 at 12:55 pm
Hi All
I have created a partition table on a database and I can see that the partition has been created. I have created an other table where i want to switch the partition to, This partition table has got all the same structure, but when i tried to switch partition i am getting the below error.
SQL used to switch the partition
ALTER TABLE CDR_0_test
SWITCH PARTITION 10
TO [CDR_0_Test_Part]
GO
Error recived
Msg 4913, Level 16, State 1, Line 1
ALTER TABLE SWITCH statement failed. The table 'GBR_Test.dbo.CDR_0_test' has clustered index 'GBR_CDR_0_Test_IX_Xharging_TimeStamp_Partition' while the table 'GBR_Test.dbo.CDR_0_Test_Part' does not have clustered index.
Thanks for your help in advance
November 22, 2010 at 1:07 pm
The error states that the clustered index is different. Is it?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 22, 2010 at 1:56 pm
The table 'GBR_Test.dbo.CDR_0_test' has clustered index 'GBR_CDR_0_Test_IX_Xharging_TimeStamp_Partition' while the table 'GBR_Test.dbo.CDR_0_Test_Part' does not have clustered index.
?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
November 23, 2010 at 2:46 am
Thanks Gail
I have tried with the clustered index as well, but when i tried with all the index that exists on the parent table its not working, now i am getting an error which is as below
Msg 7733, Level 16, State 4, Line 1
'ALTER TABLE SWITCH' statement failed. The table 'GBR_Test.dbo.CDR_0_test' is partitioned while index 'CDR_call_type_Idx' is not partitioned.
But when i went through the partitioning concept its said that partition can be moved to a non partitioned table as well.
I am a bit confused :w00t:
November 23, 2010 at 6:07 am
Thanks Guys
I have done it, I have created the table on the same file group as with the partition and then switched and it worked as a magic
Regards
😀
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply