By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,378 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,378 IT Pros & Developers. It's quick & easy.

how to use Regular Expressions

P: 17
Hi all,

Actuall there is a field given varchar(100) Now from that i need to get all the fields that contains anything other than numbers
for example:
1.2
1.3
0.0%
demo1.0,

output:
0.0%
demo1.0,
I think its easy to get this by using regular expression,
But i didn't find any material for how to use regular expressions in sql server
Help me in solving this.
May 14 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Try:

Expand|Select|Wrap|Line Numbers
  1. declare @mytable table (myfield varchar(100))
  2.  
  3. insert into @mytable values ('1.2')
  4. insert into @mytable values ('1.3')
  5. insert into @mytable values ('0.0%')
  6. insert into @mytable values ('demo1.0')
  7.  
  8. select * from @mytable
  9. where isnumeric(myfield) = 0
  10.  
May 14 '08 #2

P: 17
Thanks for giving a simple solution..
May 16 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.