1

I have a field that is varchar(100) - if the field is all text, I want to ignore it, if it is alpha-numeric I want to return the data. This is sample DDL and my ISNUMERIC() excludes both values (I assume because they contain text with the numbers).

How should this be altered in order to return any value that is not just text?

Declare @Table Table (field1 varchar(100))
Insert Into @Table Values 
('1ZCLJKSDFLKSJDF'), 
('0301190XFS3'), 
('Pink Socks Run Free'), 
('White Goats Stink')
Select * from @table where ISNUMERIC(field1) >= 1
asked Jan 19, 2017 at 19:41

1 Answer 1

4

Fairly simple:

Select * from @table where field1 LIKE '%[0-9]%'
answered Jan 19, 2017 at 19:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.