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

196 reads

Blogs

Daily Coping 20 Apr 2021

By

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

The Diverse Data Platform–Dativerse.io

By

The other day I got a note from Ben Weissman the other day that...

Extended Events and Azure SQL Database

By

Knowledge of how your system behaves is vital to better control, maintain, and grow...

Read the latest Blogs

Forums

Getting sum of all transactions by month-end

By callen-557064

I have a table that is a list of inventory transactions. For simplicity sake,...

usage of BCP and BULK INSERT

By 892717952

as I'm not clear how to use bcp and bulk insert in the following...

sequence of SQL server execution plan

By 892717952

As per my understanding,  when we read the execution plan, the sql server is...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers