Scripts

Technical Article

Script to Show All Failed Jobs in Specified Period

This script will allow you to create a stored procedure that will check a server for any jobs that have failed in a specified number of days. It has proven valuable to me, since I have servers with lots of jobs that run frequently; I got tired of checking the history of each job to […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(4)

You rated this post out of 5. Change rating

2002-01-01

4,512 reads

Technical Article

sp_dba_checkblocked fix for sp_NotifyBlock

Problems with error 512 more than 1 result returned due to the operator outside of the query. Found this when tested with multiple blocks going on at once. It worked fine when there was only 1 block. Depending on the type of server there can be a "whole lot of blocking going on "Replaced with […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2002-01-01

856 reads

Technical Article

Monitor File Growth - Set Based sp_MSforeachdb

This is a script, similar to some you have seen in the past, that will monitor file growth on all databases for the given server. This script is not a fancy solution that has a tons of bells and whistles but, it is efficient. The script is a concantanation of the create table / populate […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(2)

You rated this post out of 5. Change rating

2001-12-21

3,430 reads

Technical Article

Granting Access Permissions...

Usually when we recreate or rename a table we need to give the appropriate access permissions to the SQL users...this is very common in database under development environment where frequently table structure changes and we have to recreate it....we can accomplish this with Enterprise Manager but what will you do if Enterprise Manager fails to […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2001-12-18

866 reads

Technical Article

List Table Definition

System Stored Procedure to List the Table Definition of a table as a printable report. The procedure must exist in the master database. This works for any table in the current database. Do not fully qualify the tablename. Calling sample: use pubs exec sp_listtabledef 'authors'

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(3)

You rated this post out of 5. Change rating

2001-12-18

3,458 reads

Blogs

Goodbye, Microsoft

By

A few years ago I took a new job at Microsoft, working as a...

The SUM of Nothing: #SQLNewBlogger

By

I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...

How to Move the SSMS Status Bar to the Top and Color-Code SQL Server Connections

By

I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...

Read the latest Blogs

Forums

ALAMAT BCA KCU SURYOPRANOTO Tlp:08218520154

By layanan_Bca88

WhatsApp CS 628218520154 Jl. Suryopranoto No.40, RT.12/RW.7, Petojo Utara, Kecamatan Gambir, Kota Jakarta Pusat,...

Alamat BCA KCP Sentral Cikini Telp:08218520154

By R4nt4u

WhatsApp CS 628218520154 Jl. Pegangsaan Timur No.1, Cikini, Kec. Menteng, Kota Jakarta Pusat, Daerah...

Alamat BCA KCP Pintu Air Telp:08218520154

By m4rt1n4

WhatsApp CS 628218520154 Jl. Pintu Air Raya No.36 Q, RT.6/RW.1, Ps. Baru, Kecamatan Sawah...

Visit the forum

Question of the Day

Finding Trailing Spaces

I have some data in a SQL Server 2025 database. It looks like this for the dbo.Customer table:

CustomerID CustomerName PreferredName
1          Steve        Steve               
2          Andy         Andy               
3          Brian        Brian               
4          Allan        Allan               
5          Devin        Devin               
6          Steve        Steve               
7          Sally        Sally
I want to detect which names have a single trailing space. The CustomerName is a varchar() and the PreferredName is a CHAR(). Does this query detect the problem rows?
SELECT 
       CustomerID,
       CustomerName,
       PreferredName
FROM Customer
WHERE CustomerName <> RTRIM(CustomerName)
OR PreferredName <> RTRIM(PreferredName);

See possible answers