|
Posted by jim_geissman on 02/02/06 20:04
I have data tables that include ZIP code, as char(5). The values look
like integers, but they are padded with leading zeroes to fill out 5
characters, '00234'.
There are SPs to look up data, with @Zip char(5) among the parameters.
Some users call these with integer values, @Zip = 234, and SQL makes
the conversion. Is it necesary to add the leading zeroes in the SP --
@Zip=RIGHT('00000'+@Zip,5) -- or would SQL find this match? (234 =
'00234'). It looks like the conversion is to '234' and the match
fails.
Thanks,
Jim Geissman
Countrywide
[Back to original message]
|