Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Special char in LIKE

Author  Topic 

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2013-03-05 : 10:21:37
Hello All,

I have to give [dbo]. string in my LIKE clause.

Here is the code

CASE WHEN Wait_Query LIKE '%[dbo].%'

SQL is treating [dbo]. as dbo. It is ignoring square brackets. Can you please tell me how to correct it?

Thanks,
-S

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2013-03-05 : 10:30:24
You need to escape the brackets

CASE WHEN Wait_Query LIKE '%[[dbo]].%'


Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-05 : 10:33:33
see

http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -