Removing leading zeroes from a field in a SQL statement
Solution 1:
select substring(ColumnName, patindex('%[^0]%',ColumnName), 10)
Solution 2:
select replace(ltrim(replace(ColumnName,'0',' ')),' ','0')
select substring(ColumnName, patindex('%[^0]%',ColumnName), 10)
select replace(ltrim(replace(ColumnName,'0',' ')),' ','0')