Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Switching partition giving error "Schema changed after the target table was created. Rerun the Select Into query"

$
0
0
Hello Everyone,I am working on migrating existing database to partitioned environment. We have a table name dbo.TableName which is partitioned based on State Code (with total 50 partitions). Now there was a process which deletes all the data for one state code and insert it again from different server (source). As data is partitioned based on State Code i thought of using switch function to get the same result instead of delete. For different State Code process is running in parallel (maximum 3 state codes at a time) but sometimes one of the process getting error-ed out with message "Schema changed after the target table was created. Rerun the Select Into query". I am not getting error always. Can someone help what i am missing here. Below is the order of queries which will get executed in parallel for 2 different state codes.--For State Code XSelect Top 0 * into dbo.TableName_X from dbo.TableNameAlter Table dbo.TableName Switch Partition X to dbo.TableName_XDrop table dbo.TableName_X--For State Code YSelect Top 0 * into dbo.TableName_Y from dbo.TableNameAlter Table dbo.TableName Switch Partition Y to dbo.TableName_YDrop table dbo.TableName_YAny help is highly appreciated.Thank You in advance.

Viewing all articles
Browse latest Browse all 3145

Trending Articles