I have a SQL server Table that has a varchar
column that can save up to 4 characters
When we insert a value 963 into this column we have to add a leading "0" to this
for example:
- if I insert 23 the value should be saved as 0023
- if I insert 236 the value should be save as 0236
- if I insert 2369 the value should be saves as 2369
Can we add a AFTER trigger to this table, to check if the value inserted is less than 4 digits, and to update the same value in that column with Leading "0"s appended to that value
Will this affect the performance of the Trigger? Is it a good practice to have a trigger to update the value in the same table?