zPad() - add leading zeros to a number
This user-defined function converts a number to character format and adds leading zeroes to pad the field to a specified length. useful for displaying SSNs or other numeric fields where the leading 0's are significant but the field is stored as numeric.To use:select dbo.zPad(, )make sure your length includes an extra column for the sign. […]
2002-12-05
396 reads