A problem in partition table ? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

A problem in partition table ?

1) HIS_HTTP_LOG a partition table
2) REL_HTTP_LOG not a partition table,the same structure of HIS_HTTP_LOG£»
3) In the beginning, there is not any index in HIS_HTTP_LOG ,the following executed succeed ALTER PARTITION SCHEME PS_HIS_HTTP_LOG NEXT USED [FG_03] ALTER PARTITION FUNCTION PF_HIS_HTTP_LOG() SPLIT RANGE (‘20070331 23:59:59.997’) ALTER TABLE TMP_HTTP_LOG SWITCH TO HIS_HTTP_LOG PARTITION 3 4) However when I added the index in HIS_HTTP_LOG and execute the step 3,It made error:
a) CREATE INDEX IDX_HIS_HTTP_LOG_001 ON HIS_HTTP_LOG(USERID)ON PS_HIS_HTTP_LOG (STARTIME)
b) ALTER PARTITION SCHEME PS_HIS_HTTP_LOG NEXT USED [FG_03]
ALTER PARTITION FUNCTION PF_HIS_HTTP_LOG() SPLIT RANGE (‘20070331 23:59:59.997’)
ALTER TABLE TMP_HTTP_LOG SWITCH TO HIS_HTTP_LOG PARTITION 3
================== Error messages==================================
"ALTER TABLE SWITCH statement failed. There is no identical index in source table ‘TMP_HTTP_LOG SWITCH ‘ for the index ‘IDX_HIS_HTTP_LOG_001’ in target table ‘HIS_HTTP_LOG’ ." When I added index in REL_HTTP_LOG ,it also gave me the same error message Could you tell me how can I solve the problem !

The problem had been solved it’s my mistake I build the index on the wrong filegroup

Appreciate your feedback against your own question, that helps. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
]]>