Maintenance and Management

Technical Article

Track Long Running Queries

  • Script

SQL2000 only.We use the attached script to schedule a SQL Agent job that sets up a Profile trace looking for long queries, and hourly imports them into a table.  This way we can historically (but with some degree of real time) look to see what queries put a load on the system.  We then allow […]

5 (1)

You rated this post out of 5. Change rating

2003-08-23

1,475 reads

Technical Article

Delete old backup files

  • Script

A stored procedure and two functions that given a path, a date and a file extension will do one of the following:-Delete all files of the supplied extension in that directory before a certain date.-Delete everything before the last full backup.I use this because disk space is tight and maintenance plans seem to delete old […]

You rated this post out of 5. Change rating

2003-08-21

716 reads

Technical Article

Get Filegrowth info from backuphistory

  • Script

This uses info in backup tables to display growth of datafiles (LDF and MDF) and actual datagrowth (backupsize)  over a period of time.  Replace parameter values with name of your database and date from when you want info displayed. Results are best viewed in grid.

5 (2)

You rated this post out of 5. Change rating

2003-08-20

399 reads

Technical Article

Script to View Server's Free HD Space

  • Script

This VBScript script lets you display the available disk space in each one of your administered DB servers.You have to call it with ONE argument: the filename of an archive that contains a list of known servers over which you have administration permissions.  If you program VBScript, you can put alarms when any drive goes […]

You rated this post out of 5. Change rating

2003-08-13

420 reads

Technical Article

Table Size Estimator

  • Script

This script will output an estimate for the space required for a given number of rows for a specified table; the estimated size is based on the data produced by the "sp_spaceused" stored procedure.The script is written as stand alone, though it also lends itself to creation as a stored procedure, and can be run […]

You rated this post out of 5. Change rating

2003-08-07

4,719 reads

Technical Article

Display Database, File, Free and Total Disk Space

  • Script

This script displays the size of each SQL Server database and database file plus the size of the next extension that will be added to each file. It also displays on each line the total and remaining free disk space for whichever disk each database file is stored on.The output is nothing fancy, and could […]

1 (1)

You rated this post out of 5. Change rating

2003-07-30

1,311 reads

Technical Article

Resize data file manually to prevent downtime

  • Script

This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and […]

You rated this post out of 5. Change rating

2003-06-19

650 reads

Blogs

Advice I Like: Praise

By

Don’t reserve your kindest praise for a person until their eulogy. Tell them while...

How to Install SQL Server 2025 RC0 on an Azure VM

By

I wanted to try out the new JSON index which is for the moment...

Prepping for Certification, Part 1 of ?

By

I thought it would be good to put my thoughts down on how to...

Read the latest Blogs

Forums

Learning a New Language

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Learning a New Language

is there a way to "detect" schema like changes on a server?

By stan

Hi, we have a few people who like to experiment on our prod sql...

Guidelines and Requirements

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Guidelines and Requirements

Visit the forum

Question of the Day

Copying Production Schema

If I use DBCC CLONEDATABASE, can I remove some of the information from the copy?

See possible answers