Data Archival/Purging - through table partition switch IN/OUT

  • Hi All,

    I have a daily partitioned table 'TBL' and I hold data for 30 Day's. I archive data to TBLHistory table by Switch out minimum partion and switch in the partition to TBLHistory.

    The Main Table 'TBL' and 'TBLHistory' resides on the same database. As a result size of database is increasing.

    My manager ask me to Create a HistoryDB database and move 'TBLHistory' to the history database.

    Can i move 'TBLHistory' to HistoryDB and still i can perform switch out and Switch in?

    Note:Both DBs are residing on same instance of the server.

    (MainDB) -->TBL-->SwithOut to --> Swith In to --> (HistoryDB)-->TBLHistory ?

    Please guide me how can i best achive this.

    Thanks

    Vineet Dubey

  • vineet_dubey1975 (3/6/2013)[hr

    Can i move 'TBLHistory' to HistoryDB and still i can perform switch out and Switch in?

    Note:Both DBs are residing on same instance of the server.

    NO . for switch-in & switch out , tables should be resided on partitoned filegroups. see this link http://sqlserverpedia.com/wiki/Switching_Partitions_-_Example

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • My both the DBS are on same file filegroup e.g. PRIMARY.

  • vineet_dubey1975 (3/7/2013)


    My both the DBS are on same file filegroup e.g. PRIMARY.

    Refer the link i posted above

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply