• hello,

    there are several requisites to switch data in a partitioned table from an non-partitioned table (called staging/standalone table in Microsoft whitepapers).

    You may read the whitepaper : http://technet.microsoft.com/en-us/library/dd578580(v=sql.100).aspx

    For example :

    - the partition (of the partitioned table) which will recieve datas must be empty

    - if the partitioned table is partitioned on several filegroups, the staging table AND the partition (partition of the partitioned table) must be on the same filegroup.

    - the 2 tables must have the same structure (same column names, same data type for each column, same foreign key, same constraints, same index (index must be aligned)....)

    You may look at section "Using the ALTER TABLE SWITCH Option" page 29 line "SWITCH Requirements in the whitepaper"

    You may look at the tutorial : http://www.mssqltips.com/sqlservertip/1406/switching-data-in-and-out-of-a-sql-server-2005-data-partition/

    But this tutorial does not mention index subject for the switch

    I an french, so do not blame me for my English level 🙂

    Franck