29 November 2007

T-SQL: Create All Backups

First and foremost, always have a backup. Check out CreateBackupAll.sql to create backups and maintenance jobs for all user databases. Modify the settings for transaction log backups, re-indexing and database consistency checks.

If you use the index rebuild, you will need the
sp_rebuild script. Procedure sp_rebuild uses dbcc dbreindex to re-index the clustered index, which takes care of all supporting indices. This may not be the best option for all of your databases. There are a few re-indexing options. With SQL 2005 Microsoft is suggesting alter index rebuild over defragindex and dbreindex.

No comments: