开发者

Drop and create table inside transaction on SQL Server, impact on other processes

On SQL Server 2005, is it possible to drop and recreate a table (copy from another database) inside of a transaction?

Also, would any process trying to access that table during the transaction fail or w开发者_Go百科ait for the transaction to complete?


Copy the data into a different table, then switch the old and new tables. Use either sp_rename or see Transferring Data Efficiently by Using Partition Switching. The later option is better because it preserves all permissions and constraints on the table, but it does require Enterprise Edition.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜