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

Microsoft Tools That Help Query Tuning

By

Query tuning is not easy. In fact, for a lot of people, you shouldn’t...

Author of the Year 2019 Nomination at MSSQLTips

By

This year I’ve been nominated again for the Author of the Year award at...

Extended Events Misperceptions: Profiler is Easier

By

I know, I know, I’m on #teamexevents so I think that Extended Events can...

Read the latest Blogs

Forums

Transcation Log Backup Restoration Time

By Harshana-455711

Hi Is anyone know please advice, how much time will take for restoration 250GB...

how to create query based on optional field on temp table ?

By ahmed_elbarbary.2010

problem how to create query based on optional field on temp table ? I...

how to create query based on optional field on temp table ?

By ahmed_elbarbary.2010

problem how to create query based on optional field on temp table ? I...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers