Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. --When you have a number that needs to be formatted with leading zeroes
  2.  
  3. DECLARE @idnumber INT= 80253;
  4. SELECT @idnumber AS idnumberint,
  5. RIGHT('000000'+CAST(@idnumber AS VARCHAR), 6) AS idnumbervarchar;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement