I load data from a text file and it seems that it does not contain leading space, however when I SELECT from a table, I see the leading space but cannot remove it with a LTRIM
function:
SELECT ltrim(DATA) FROM MYTABLE WHERE LineNumber = 4
I'm getting the following:
T000000000004
with a single leading space before T
When I do select convert(varbinary,data) from mytable
, that's what I get:
0x0A54303030303030303030303034
In the file it looks ok: T000000000004
- no leading space and it starts from the first character in the file. However, in the table it's inserted with a leading space.
How can I fix it?