Swapping ms-sql tables

前端 未结 6 2052
执笔经年
执笔经年 2021-02-05 08:17

I want to swap to tables in the best possible manner.
I have an IpToCountry table, and I create a new one on a weekly basis according to an external CSV file which I import.

6条回答
  •  我在风中等你
    2021-02-05 09:05

    Just ran into a similar issue working on a staging table that had issues scaling with proper locks.

    Everywhere your table is referenced you could call a stored procedure asking for the table name.

    The stored procedure would optionally create the new table(s) or return the old tables depending on the parameters provided.

提交回复
热议问题