Tara Kizer Blog

Tara Kizer

Defragmenting indexes in SQL Server 2005

To defragment your indexes, we now use ALTER INDEX in SQL Server 2005 rather than DBCC DBREINDEX and DBCC INDEXDEFRAG, which have both been deprecated in 2005. The REBUILD option of ALTER INDEX is equivalent to the old DBCC DBREINDEX; the REORGANIZE option of ALTER INDEX is equivalent to the old DBCC INDEXDEFRAG. Read more →

KILL spids

To quickly disconnect all non admins from a database, I use this: ALTER DATABASE Database1 SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE Database2 SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE One of the development teams recently requested that their production databases be copied to a development server on a weekly basis. Read more →