This is based on Clint Herring's work and was better than what I was using ;). It has one user definded variable @path that is where to store the files generated. It will make one file per database and one master file to restore all user permissions into that database. Used mostly for DR and […]
2005-03-30 (first published: 2004-05-25)
1,016 reads
Creates the required table and stored procedure to facilitate the import ofEvent Log WARNING and FAILURE entries from a target computer into a SQL using Microsoft's LogParserfor monitoring and analysis.In order to import and analyze a number of computers' Event Logs, you should create a scheduled taskwith a series of steps that each execute this […]
2005-03-28 (first published: 2005-01-04)
1,273 reads
Executes a file containing T-SQL code without using OSQL. The file can be up to 80,000 characters. Each line in the file should be no more than 256 characters. (Customize the code as needed.) The DOS Type command is used to retrieve the code. Embedded "go"s are removed so don't expect termination behavior. The only […]
2005-03-25 (first published: 2004-07-14)
528 reads
This script will check to see if a directory exists and if it does not then it will create the directory. I did not create this as a stored procedure but it certainly could be. I tend to just place this as one of my job steps so I can create a backup file of […]
2005-03-24 (first published: 2005-03-08)
625 reads
Analyze a table contents for type of information. Returns the number of distinct values for each field and the list and frequency of those values when specified
2005-03-22 (first published: 2005-03-04)
691 reads
This script will show you how much diskspace can be reclaimed by shrinking all the logfiles of userdatabases using a DBCC SHRINKFILE(2) command. Often the spacegain is much smaller then expected. SQL Shrinks logfiles the end of the file until it finds the active part of the logfile. (If the active part of the logfile […]
2005-03-21 (first published: 2005-03-04)
426 reads
This stored procedure is created to be invoked (in my case by SQL Server scheduled job), and will then create a tracefile to a specified file location (ensure that if this is NOT local, your SQL Server Agent runs on a domain account that has access to that drive. The Stored procedure will create files […]
2005-03-16 (first published: 2005-03-04)
433 reads
This Procedure will display info regard to when the last time database was used. How to use it--------------Exec master.dbo.Sp_LastTimeDBUsed 'pubs'
2005-03-15 (first published: 2005-03-02)
1,058 reads
Easily extractss the complete stored procedure call hierarchy from "sysdepends" table of SQL Server and represent it in a pseudo-graphical tree-view.The script uses a temporary table (automatically created/dropped) to hold children and parents of relationships. For representing the call hierarchy the table contains a level field (depth) and a field containing the "enumerated path" (using […]
2005-03-14 (first published: 2005-03-01)
3,922 reads
/*--Objective : To Write a given string on to a given file--Created by: Helen--Date : Jan 4, 2005--Execution : SELECT * FROM DBO.Ufn_WriteToFile('D:\Testing\dbcc.TXT','Hello world')*/
2005-03-10 (first published: 2005-02-21)
574 reads