MyTable
MyTableStaging
sp_rename
begin Tran begin try execute sp_rename 'MyTable', 'MyTableTemp' execute sp_rename 'MyTableStaging', 'MyTable' execute sp_rename 'MyTableTemp', 'MyTableStaging' Commit Tran end try begin Catch rollback tran rename end catch
exec sp_rename 'MyDb', 'MyDb_Temp', 'DATABASE' GO exec sp_rename 'MyDb_Staging','MyDb', 'DATABASE' GO exec sp_rename 'MyDb_Temp', 'MyDb_Staging', 'DATABASE' GO
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.