Skip to content

Instantly share code, notes, and snippets.

@b2977053
Last active December 13, 2019 10:09
Show Gist options
  • Save b2977053/60b0996785d1dc775052ce37e323b2fe to your computer and use it in GitHub Desktop.
Save b2977053/60b0996785d1dc775052ce37e323b2fe to your computer and use it in GitHub Desktop.
PRINT REPLICATE('A--', 3) -- A--A--A--
-- 補零
DECLARE @C1 varchar(4) = '12';
PRINT DATALENGTH(@C1) -- 2
PRINT REPLICATE('0', 4 - DATALENGTH(@C1)) + @C1 -- 0012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment