With SQL Server 2014, I have a nvarchar(10) column with values like this
9998 03345 05567 6675
I need to add a left padded "0" to all the cells that are 4 digits long so that all values are 5 digits.
How do I write an update that will take into account the width of the current value?
update MyTable set MyField= RIGHT('00000' + ?????, 5)