This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Check the below sample solutions and for checking the string is a number or not in SQL Server.
Solution 1:
1 2 3 4 |
DECLARE @str VARCHAR(50) SET @str ='888ABC'; SELECT CASE WHEN @str NOT LIKE '%[^0-9.-]%' THEN 'Yes Numeric' ELSE 'Not Numeric' END IsNumber |
Solution 2:
1 2 3 4 5 6 7 8 9 |
DECLARE @str NVARCHAR(100) = '888' IF(ISNUMERIC(@str) = 1) BEGIN PRINT 'Yes Numeric' END ELSE BEGIN PRINT 'Not Numeric' END |
Please try the different solution for this puzzle and share it via comment...