I have a requirement as below:
SELECT code from Products
- Select code to table Products
- Check length of code; if < 8 auto insert "0" before it to enough 8 character.
Sample:
If code is : 1234 => 00001234
12345 => 00012345
..... => xxxxxxxx
I want to use a stored procedures in SQL Server 2012 to do it.