Skip to content

Instantly share code, notes, and snippets.

@tompazourek
Last active September 13, 2017 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompazourek/d24817cfbe8c021a070aa2bc4b3548a8 to your computer and use it in GitHub Desktop.
Save tompazourek/d24817cfbe8c021a070aa2bc4b3548a8 to your computer and use it in GitHub Desktop.
SELECT CONCAT('ABC', REPLICATE('0',6-LEN(CAST(other_id as nvarchar(max)))), CAST(other_id as nvarchar(max)))
FROM [experiments].[dbo].[Table_1]
SELECT CONCAT('ABC', FORMAT(Other_Id, '000000'))
FROM [experiments].[dbo].[Table_1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment