CompCodeBoy
Programmer
I have an input parameter in a stored procedure "@TicketNumber BigInt". I need to check the length of the parameter. If the length is 18, then all is fine. If the length is 17 then I need to append a '0' to the beginning of the parameter. If the length is 16, then append '00' and so on ... What is the best way of doing this? I'm thinking of using CASE statement but a CASE STATEMENT in T-SQL has to be included within a SELECT STATEMENT. Any help or ideas would be appreciated!