I need to convert int datafield to nvarchar with leading zeros
example:
1 convert to \'001\'
867 convert to \'000867\', etc.
thx.
Try this: select right('00000' + cast(Your_Field as varchar(5)), 5)
select right('00000' + cast(Your_Field as varchar(5)), 5)
It will get the result in 5 digits, ex: 00001,...., 01234