Technical Article

Pad Number

A simple UDF for padding out numbers with a specific character (eg: pad 3 to show as 003).Usefull when you can only sort as a text item or for formatting purposes.Script is similar to the SPACE() function but allow the padding character to be defined.Usage:dbo.padNumber('string to pad', padsize, padchar)eg:SELECT dbo.padNumber('53', 4, '0') as testNumReturns:testNum-------0053

2003-07-25

197 reads

Blogs

Hiding Email with a Dynamic Data Masking Function–#SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Get SQL Server 2022 Now: It’s Called Azure

By

If you’re like me, your palms went into a cold sweat to get your...

Daily Coping 29 Nov 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

Help with SQL Query

By Hogie503

Hello SQL experts, Please see attached file for table detail. I have a temp...

Retry SQLAgent Job

By MrBen

Hello. Does anyone know how I can retry a job should any one of...

Get Summary Data for Last 52 weeks by Week

By skb 44459

I have a table which stores shipment data by date. We have a need...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers