This script creates a SQL_Statistics table in the Mater Database and then scroll through the existing databases on the server and gathers the Servers Name, logical device name, the file name and the file size and writes it to the table alond with a date time stamp.We run it once a month to gather the […]
2005-02-22 (first published: 2005-02-01)
539 reads
The script runs using vbscript code. It requires the user to enter parameters and run the script. The script uses both trusted and standard connection. The script also generate a log file each time it runs. Copy the code below and save it with .vbs extension.
2005-02-21 (first published: 2005-01-31)
297 reads
You can return the date as a string (varchar) in whatever date format you like by adding a 'style' to the CONVERT statement. Exmaples of style values are (two left hand columns):1 101 USA mm/dd/yy 2 102 ANSI yy.mm.dd 3 103 British/French dd/mm/yy 4 104 German dd.mm.yy 5 105 Italian dd-mm-yy 6 106 - dd […]
2005-02-18 (first published: 2005-01-31)
201 reads
This script will help DBA's who wants to BCP out required tables form any database. This script can be run through as a job. Before running you have to create a table in any given database and store the table names in it, which you want to Bulk copy. Query in this procedure will check […]
2005-02-17 (first published: 2005-01-27)
294 reads
There are mainly two components. One job that is managing the full database backup - restore and a second job that manage the transaction log backup - restore. At this two a new one similar with the full database backup - restore can be added for the differential backups if is the case. I will […]
2005-02-15 (first published: 2004-04-01)
1,037 reads
This Stored Procedure Will Get: - The Data and Log File Names - The Data and Log File Sizes (MB) - The Data and Log Percent Utilization (%) for ALL Databases on a SQL Instance. Numbers Should (More Or Less) Reflect What You See on The SQL Enterprise Manager Taskpad. LIMITATIONS: For Databases With Multiple […]
2005-02-14 (first published: 2005-01-13)
1,155 reads
Imports data from MySQL Server; works best with mysql driver 3.51.06! You'll have to create a dsn and then a linked server to that dsn. The script checks if the table exists in the mysql catalog (defined in the dsn properties). Too bad it needs administrative privileges to run (dbcc statement) - my advice: don't […]
2005-02-11 (first published: 2005-01-17)
130 reads
Kmlakov's script, t-sql function to parse string data, posted on 1/19/2005, required the passing in text ends with the delimiter. But it is usually not the case. I rewrote the script (added one IF statement). The new script can treat the text with or without ending delimiter. The third parameter will be the number of […]
2005-02-07 (first published: 2005-01-19)
384 reads
select dateadd(dd, datediff(dd,0,Getdate()),0)
2005-02-01 (first published: 2005-01-06)
152 reads
This script will get you the current date minus the time. It will display all zeros instead.DATETIME is stored as a number in SQL and less internal conversions are will be used then other methods. Microsoft generally uses this method.
2005-01-31 (first published: 2005-01-06)
238 reads