I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'.
Loading
Dorababu MekaPosted Jul 6, 2011, 5:51 AM
Select Substring(Yourcolumnname,patindex
('%[^0]%',ColumnName), 10)
Suthish NairPosted Jul 6, 2011, 6:02 AM
ChaitanyaPosted Jul 6, 2011, 5:57 AM
Suthish NairPosted Jul 6, 2011, 5:53 AM