I can’t find a specific answer to this question online. If I take a tinyint field and cast it like so: ‘(DT_STR,2,1252)some_id’ what happens with the single digit numbers? Does a 7 become ‘7’ or ‘7 ‘?
I found some documentation on the MSDN site that the string is null terminated and truncates, but it didn’t specifically say what happens to an int that is shorter than the cast.
Thanks!
In scenarios like this, I find it’s easier to just test and observe.
OLE DB Source
Simple query that ensures we have the correct data type
Derived Column
Cast our tinyint to a string and add something at the end to view whether it’s left or right padded.
Results
I was actually surprised, I’d have expected it to be right padded but that’s not case.