How to Get SQL Records Starting with Numbers Only
by
Doug
Updated May 12, 2018
Return SQL records starting with numbers [0-9] only.
Here's a quick SQL tip on how to get records beginning with numbers only. Use the query string LIKE '[0-9]%' For example:
SELECT u.UserId, u.UserName
FROM dbo.aspnet_Users u WHERE u.UserName LIKE '[0-9]%'
ORDER BY u.UserName
Keep in mind, If you are using a stored procedure and sending [0-9]% to the proc in a @Parameter, do NOT surround [0-9]% with single 'quotes', because the query may not work right (in SQL Server 2008.)