Scripts

Technical Article

Track Long Running Queries

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 […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2003-08-23

1,498 reads

Technical Article

Compare Parallel Data Streams

This a script to compare two parallel data streams, in my case production and QA.  Two extracts were created and a mapping table was created as a look-up between old and new recordids.  A final table TestResults was created to hold the results of the comparison.  The comparison table names and join syntax are controlled […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-08-21

174 reads

Technical Article

Delete old backup files

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

734 reads

Technical Article

Display Defragmentation Of Selected Tables

This script will display the defragmentation of table(s) all indexes of selected tables and display a table/list of the DBCC SHOWCONTIG. It will aslo will report if there are tables in the list that can't be found in the current database. Run the script in the database where the tables you want to check are.Check […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-08-21

815 reads

Technical Article

Get Filegrowth info from backuphistory

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.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2003-08-20

416 reads

Technical Article

A more efficient ForEach routine

SQL 2000's sp_MSForEachDB and sp_MSForEachTable are useful procedures for performing operations against multiple objects; however, they aren't always extremely efficient, because internally they use cursors to do their work.These 2 sprocs, sp_ForEachDB and sp_ForEachTable, perform many of the same tasks as their Microsoft-shipped twins, but run faster because they dynamically build the SQL string without […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2003-08-19

2,306 reads

Technical Article

Column_Gitter Part Deux

This script is similar to Column_Gitter.  I noticed this script and wanted to present the same output without the use of cursors.  Both scripts work well and produce the same results.  This little utility comes in handy if you do a lot of SQL coding. Given a table name, it'll return four results: The names […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2003-08-14

120 reads

Blogs

Microsoft Tools for Making Data AI-Ready

By

Making Data AI-Ready, Part 2 (This is the second article in a three-part series...

Local Models Using GPUs with Ollama

By

Can you use your GPUs when running a local model under Ollama? You can,...

Don’t Fear the Technology

By

The concern that a particular technology is going to destroy the world seems to...

Read the latest Blogs

Forums

Moving Beyond the Reboot: Finding the Culprit Behind Memory Pressure

By Pablo Echeverria

Comments posted to this topic are about the item Moving Beyond the Reboot: Finding...

Reserved Words I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Reserved Words I

Get Along

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Get Along

Visit the forum

Question of the Day

Reserved Words I

Which of these are not reserved words?

See possible answers