Scripts

Technical Article

Show Fragmentation Before and After Reindex

This will show the fragmentation and stats before and after a reindex of a specified table. Run in the context for the db that holds the table the proc will get passed and re-index. Complile in master since the master is checked first for any SP that is prefixed with SP_ and you can call […]

You rated this post out of 5. Change rating

2001-08-13

4,043 reads

Technical Article

SQL Server Current Activity SuperCheck

This gives a quick check of the current activity on a SQL Server. I developed this after getting continually frustrated with "Current Activity" in SQL/EM getting blocked by processes when I needed to see blocking issues on the server. It has been immensely valuable to me in quickly identifying production-stopping issues on the database. It […]

(5)

You rated this post out of 5. Change rating

2001-08-13

4,897 reads

Technical Article

Optimize Character Field Usage

This stored procedure was designed to scan all your character based columns in a particular database and show the minimum, maximum and average data length. As well as give an efficiency rating of the data stored. Input: None Output: Table name, Column name, Defined datatype and length, Average length of data for that column, Minimum […]

You rated this post out of 5. Change rating

2001-08-10

1,700 reads

Technical Article

Email using CDONTS (via smtp)

Here is a very basic example script for sending emails via CDONTS. This comes from the sqlmag web-site forum. Although fine, remember that it will use the local SMTP server to forward emails onto the destination user. If your servers smtp process can not reach an exchange/group-wise/other mail box on your network, then this code […]

You rated this post out of 5. Change rating

2001-08-09

3,583 reads

Technical Article

Generate Insert Statements Easily

This script will generate insert statements for the given tables. You can pass the tables names, separated by commas, into sp_DataAsInsCommand stored procedure as in the example below: EXEC sp_DataAsInsCommand 'employee,titleauthor,pub_info' Updated on 5/25/01 to correct an issue with columns that are short like a column defined as char(1), to correct another issue with the […]

(9)

You rated this post out of 5. Change rating

2001-08-09

4,658 reads

Technical Article

Drop all Connections from a Database

On development servers, at times there is a need for dropping and renaming database(s). These scripts can be used for achieving these tasks. The usp_DropDB script will kill the connections to the database and then drop the database. It takes care of the space in the database name, if any and also makes sure that […]

(2)

You rated this post out of 5. Change rating

2001-08-08

5,483 reads

Blogs

Power BI Performance in 2026: A Practical Guide to Faster Semantic Models and Reports

By

Originally published April 2022; substantially updated July 2026. This post is a complete replacement...

Getting Started with Azure SQL Developer on Macbook

By

The idea behind Azure SQL Developer is for anyone to build, iterate, and test...

AI Experiments: Claude Solved a DAB Issue

By

I’m sure many of you are using AI regularly, perhaps chatting, perhaps using some...

Read the latest Blogs

Forums

Alamat Kantor BCA KCU Batam Telp:08218200203

By m4rt1n4

Hub Via Wa:628218200203 Alamat: Jl. Dokter Sutomo No.50-50A, Ps. Jambi, Kec. Ps. Jambi, Kota...

Alamat Kantor BCA KCU Kisaran Telp:08218200203

By R4nt4u

Hub Via Wa:628218200203 Alamat: Jl. Cokro Aminoto No.28, Kisaran Kota, Kec. Kota Kisaran Barat,...

Alamat BCA KCU Pematang Siantar Tlp:08218200203

By layanan_Bca88

Hub Via Wa:628218200203 Alamat: Jl. Merdeka No.39, Proklamasi, Kec. Siantar Bar., Kota Pematang Siantar,...

Visit the forum

Question of the Day

Limiting Checkpoints

If I use the -k parameter with a number after it, what does this change in SQL Server?

See possible answers