Scripts

Technical Article

MSP_Restore

Simple Procedure to rapidly rebuild a copy of Development TEST1 DB...Lovely and fast when Tard Developers have highlevels of access  and you just need them out to restore / refresh a db...KILL KILL KILL !!! Remember to reset / resolve users and permissions after this is run. I use a DTS RUN statment with a […]

You rated this post out of 5. Change rating

2003-12-18

178 reads

Technical Article

Job Status Revised.

This procedure queries the sysjobs, sysjobschedules and sysjobhistory table to produce a resultset showing the jobs on a server plus their schedules(if applicable),how often the interval occurs(every X hours,min.,days,etc), the maximun duration, last duration,last status   of the job.This is a script that I modified and added to from M.Pearson.

You rated this post out of 5. Change rating

2003-12-16

399 reads

Technical Article

Function to Format Select Queries to Columns

This function will strip all extra spaces, CRLFs and tabs from a SELECT statement, from the SELECT keyword to the End of the Order By clause, then reformat the statement to put all keywords at the left margin and subordinate clauses indented by ONE Tab.  There is an example of a SELECT statement that came […]

You rated this post out of 5. Change rating

2003-12-07

168 reads

Technical Article

Comprehensive HTML Database Documentation

This script will document tables (including constraints and triggers, row counts, sizes on disk), views (including all used fields), stored procedures (including used fields and parameters), database users, database settings and server settings.This script has been cobbled together from several others found on this site, so they deserve the recognition, not me 🙂Simply execute it […]

You rated this post out of 5. Change rating

2003-12-05

684 reads

Technical Article

Find Duplicate Indexes

There are plenty of scripts out there that find duplicate indexes, but they all seem to use cursors.  I didn't want to use a cursor so I ended up creating a few that could handle the duplicates and decided to share this one.  This will return the table name and the names of the two […]

(4)

You rated this post out of 5. Change rating

2003-12-04

2,743 reads

Technical Article

SQL Server DB Size Report

This script is similar in style to my previous script SQL Server Job Status Report, but this script generates an HTML report on the size of all databases on a specific SQL Server instance. The report consists of several sections: a summary report on the size of all databases; a summary report on the size […]

You rated this post out of 5. Change rating

2003-12-04

1,150 reads

Technical Article

Flexible searching on tables

In my company's web site there are search pages for allowing users to search info on one or more tables (or in my case a select with 10 joins). Often the requirements for these search pages change over time with users either requesting additional columns to search or remove columns that are no longer useful. […]

You rated this post out of 5. Change rating

2003-12-03

246 reads

Technical Article

Occurs

Returns the number of times a character expression occurs within another character expression.cSearchExpression -- Specifies a character expression that OCCURS( ) searches for within cExpressionSearched. cExpressionSearched -- Specifies the character expression OCCURS( ) searches for cSearchExpression.OCCURS( ) returns 0 (zero) if cSearchExpression isn't found within cExpressionSearched.

You rated this post out of 5. Change rating

2003-12-03

114 reads

Blogs

AI in SQL Server vs PostgreSQL: Vector Search, Embeddings, and RAG Compared

By

Both SQL Server and PostgreSQL are moving fast into AI territory — and if...

Monday Monitor Tips: AI Alert Analysis

By

We keep adding new AI capabilities to Redgate Monitor, where it makes sense. Check...

From SQL Saturday to Day of Data

By

A behind-the-scenes look at Day of Data Jacksonville 2026, the transition from SQL Saturday,...

Read the latest Blogs

Forums

Bank BCA KCU Tebing Tinggi telp 0817 844 112

By w4l3t4

WhatsApp CS,0817844112 Jl. Jend. Sudirman No. 225-227-229-231, Badak Bejuang, Kec. Tebing Tinggi Kota, Kota...

Bank BCA KCU Kisaran telp 0817 844 112

By w4l3t5

WhatsApp CS,0817844112 Jl. Cokro Aminoto No.28, Kisaran Kota, Kec. Kota Kisaran Barat, Kabupaten Asahan,...

Bank BCA KCU Pematang Siantar telp 0817 844 112

By m4rt1n4

WhatsApp CS,0817844112 Jl. Merdeka No.39, Proklamasi, Kec. Siantar Bar., Kota Pematang Siantar, Sumatera Utara...

Visit the forum

Question of the Day

Converting Money

Does this run successfully on a SQL Server 2022, US English default installation?

DECLARE @YenAmount MONEY;
SET @YenAmount = ¥1500; 

SELECT @YenAmount AS RawValue;

See possible answers