SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Partition Table Switch Error


Partition Table Switch Error

Author
Message
CrazyMan
CrazyMan
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2988 Visits: 1597
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)SSC Guru (224K reputation)

Group: General Forum Members
Points: 224312 Visits: 46312
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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54007 Visits: 17681

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" ;-)
CrazyMan
CrazyMan
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2988 Visits: 1597
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
CrazyMan
CrazyMan
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2988 Visits: 1597
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
:-D
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search