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

SQL server regular expression. Fetching keyword from a sentence using regular express

P: 1
I am using the below query to search some text in a sentence
Expand|Select|Wrap|Line Numbers
  1. declare @a nvarchar(100)
  2. set @a=N'%[ /\\@\&\*()\-\+\|\>?,\":;/、・¥—&*(-》>?,;“”〉\- ][public]'
  3.  
  4. declare @b nvarchar(50)
  5.  
  6. set @b='public property'
  7.  
  8. select @b where @b like '%' +@a+'%'
the problem is that I just want to fetch special character or the exact keyword.
example: I want public or &public not republic

could u please help
May 9 '14 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,430
SQL Server doesn't have support regular expressions with the LIKE operator. For more info on SQL Server's version of pattern matching using the LIKE operator, here is a link to their documentation: http://technet.microsoft.com/en-us/l.../ms179859.aspx.
May 9 '14 #2

P: 33
Sir please explain in detail so we try to give answer
May 22 '14 #3

Post your reply

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