Search
  Home
  Articles
  Backup
  Books
  Certification
  FAQ
  Products
  Replication
  Scripts
  Seminars
  Training
  TSQL

MSDN Fourms
Philippine SSUG

  Resume

MHS Enterprises
FilAm Software
AcrylicAcetate.com
Bargain Humidors
Western Humidor



sp__scramblepassword.sql I use this one for two purposes, attempts to crack security and handling stale logins.  This procedure will scramble the password for the login you specify to a random 20 character string.  I normally fire these off from monitoring procedures.   The first one tracks when the last time a login was used on a system.  If it hasn't been used within a specified timeframe, the password is scrambled which would prevent a hacker from using an old login to gain access.  The second one constantly scans the error log and notes failed login attempts.  At three failed login attempts within a 5 minute period (configurable), the password is scrambled.  This makes it virtually impossible for a hacker to crack your SQL Server passwords to gain access, because they only get 3 attempts before having to start over.
sp__defrag.sql You can spend several thousand dollars on a couple of products that help defrag your system or you can take the do it yourself approach.  This script executes dbcc showcontig against all tables in all user databases.  The scan density is extracted and compared to the threshold percentage.  If it is less than the threshold that you set, a dbcc reindex is run against the table.  This should keep your system defragmented.  This is a 6.5 script.
sp_reindex.sql Runs DBCC reindex against all tables in all user databases.
sp__dbcc.sql Provides and automated way to run dbcc and minimizes the impact upon a production environment. This script will search the output files for errors and only leave those where errors were logged.  This means you only have to check those files left in the directory that you specify.
Read about it
sp__updatestats.sql Runs update statistics against all tables in all user databases.
sp__loaddata.sql Automates the loading of data from one server to another (uses BCP)
Read about it
find_fkeys.sql Retrieves a list of primary key to foreign key relationships
Read about it
find_defaults.sql Retrieves a list of defaults and their definitions
Read about it
sp__agedata.sql Response to an interesting problem from the SQL Server mailing list for a utility that would age data to be used to validate Year 2000 efforts.
sp__backup.sql Generic script to dump all databases on a server
sp__noprimarykeys.sql Returns list of tables that have no primary key
drop_keys.sql Generates a script to drop all primary and foreign key constraints

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.