SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,436 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Suppose I have ID like 101,1923,10052... And I want all these ID in specified length which is 00101,01923,10052. Any solutions?
Hi @Evan Try this:
DECLARE @ID INT = 1923;
SELECT FORMAT(@ID,'00000');
Best regards, Cosmog Hong