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

Azure Platform Series: cloudshell code -your (brilliant) online editor

By

This post is about code which is an online editor you can use with...

Bash: ^^}: bad substitution – upgrade your Bash version (macOS)

By

This blog post is about a situation where you are capitalising an argument in...

Azure Platform Series “You have exceeded the maximum amount of scale changes within the past hour”

By

This blog post relates to where you might be doing scale operations of your...

Read the latest Blogs

Forums

Error in bcp query out

By SQL_Surfer

I've been playing around wiht bcp out the data into csv file but been...

Multi subnet failover cluster

By sqlguru

My goal is to have an FCI across 2 nodes with shared storage (node...

Power Query or SQL Server? Which, when and why

By vsanchezjauregui

Comments posted to this topic are about the item Power Query or SQL Server?...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Strange Code

See possible answers