This command with rollback all transactions immediate and give you exclusive access to the database.
for more information go to http://msdn2.microsoft.com/en-us/library/ms174269.aspx
Jorge-Novo-@ETLDEVDBA,
2012-07-13 (first published: 2008-03-20)
This command with rollback all transactions immediate and give you exclusive access to the database.
for more information go to http://msdn2.microsoft.com/en-us/library/ms174269.aspx
/* Script to set database to single user mode and close all user connections Note that this command will kill all user connections used the RollBack After command to wait for users to log out. */ Use Master go Alter Database WriteDatabaseNameHere Set Single_User With Rollback Immediate go ---Now let said you want to rename the db Alter database WriteDatabaseNameHere modify Name = WriteNewDatabaseNameHere go --Finally set database back to multi_user mode Alter Database WriteDatabasenameHere set Multi_user go
You will see here a way to handle history tables. This way only takes into account Date-based data cleanup but is easily generalizable.
2017-07-03 (first published: 2015-09-28)
11,645 reads
Alex Kuznetsov's team of developers are geared to doing rapid development of database applications in a busy corporate setting, yet take considerable time over meticulous database design, extensive constraints, automated tests, error logs, and defensive coding. Why? Because it cuts down on the subsequent need for maintenance.
2012-07-23
3,977 reads
I have a database which has several tables that have very heavy write operations. These table are very large and some are over a hundred gigabytes. I noticed performance of this database is getting slower and after some investigation we suspect that the Auto Update Statistics function is causing a performance degradation.
2011-02-25
5,231 reads
2008-08-13 (first published: 2008-06-17)
1,075 reads
2012-03-30 (first published: 2008-04-21)
3,196 reads