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

195 reads

Blogs

Using Visual Studio Code

By

I’m a creature of habit. I have my routine when I get to my...

Docker Containers and Persistent Data

By

(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get...

Cursor Dynamic SQL

By

Today was working on SQL Server cursor standard cursor deification would be like this:...

Read the latest Blogs

Forums

Numeric and Decimal

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Numeric and Decimal, which is...

SSRS Enterprise vs Standard Edition

By TUellner

I need to install SSRS for report development and deployment. I don't work with...

Suspended session

By IMary

Hi, Application service is going to hung state and when we check the database,...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers