Several potential solutions are proposed in How do you kill all current connections to a SQL Server 2005 database? which appear to solve the problem of blocking by other processes. If risk minimization is important, is detaching and attaching the database risky? Some people believe detaching databases isn't safe. What about single user mode, are there any risks with allowing a login if something went wrong in single user mode? I noticed there weren't any suggestions to disable and later reenable logins. What's the best way to prevent blocking in this situation?
Asked
Active
Viewed 51 times
0
-
I don't think there is a "best". For example, if you're changing to single user, you're probably using `WITH ROLLBACK IMMEDIATE`; in some environments that could be an awful thing to do. The "best" solution depends on your needs. Why do you need to change the name of a table while it's in use anyway? That's seems odd unto itself; this might well be an XY Problem. – Thom A Dec 09 '18 at 08:59
-
I don't like the table rename, but it's a legacy process that will be superseded in a few months. The problem is how to reduce the pain until then. When the table needs to be renamed, there are no important users on the system. Getting the task done expeditiously is more important and justifies killing all other processes. – John Paul Cook Dec 09 '18 at 23:58