AbrahamA
4Penny.net
Points: 7625

1/30/2023 2:12:50 PM

SQL Strip leading zeros

* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu

Recently I needed a piece of TSQL that would strip leading zeros from a string. 

In other words, turn this '0001234' into this: '1234'

I found a clever piece of code, blogging it below. Works pretty well, and it short and simple. 

4Penny.net
Version: Unknown or N/A
Section: SQL Scripts
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3