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

SQL Server on Kubernetes Book Published!

By

I’m super proud to announce that Ben E. Weissman and I have published SQL...

Gathering More Digital Data with Tile Slim

By

After my wallet misadventures, I ordered a Tile Slim to track my wallet. It...

Accessibility is not just about slides

By

Although I don’t write about it much on this website, I am on the...

Read the latest Blogs

Forums

subreport blank lines

By ibax

blank line in subreport

Enabling indexes

By SQLHeap

If I disable an index for a large insert/update/delete, what happens when it's enabled...

Database Triggers

By mballentine

Hi, I need to send out an email every time an alarm level is...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers