I have added a column to a table that will store a formatted string based on concatenating a number of other columns so I can search over it more easily. In order to save loading the whole table into another app and updating the new column then persisting, I want to write an UPDATE SQL query. But I can't figure out how to take an integer column and format it as in this example
Source column value = 1 Destination column value = 0001
I want the 3 leading zeros to be added in SQL.
Any ideas?