use DB_Production; --Remove User from production DB about to be swapped out exec sp_dropuser 'MyUser'; --Set to single user to close all open connections ALTER DATABASE DB_Production SET SINGLE_USER WITH ROLLBACK IMMEDIATE; ALTER DATABASE DB_Production SET MULTI_USER WITH ROLLBACK IMMEDIATE; --Rename exec SP_RENAMEDB 'DB_Production','DB_TMP'; --Set to single user to close all open connections ALTER DATABASE DB_Production_staging SET SINGLE_USER WITH ROLLBACK IMMEDIATE; ALTER DATABASE DB_Production_staging SET MULTI_USER WITH ROLLBACK IMMEDIATE; --Rename exec SP_RENAMEDB 'DB_Staging','DB_Production's; exec SP_RENAMEDB 'DB_TMP','DB_Staging'; use DB_Production; --Add User to newly swapped production DB exec sp_adduser 'MyUser';
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE