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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Special char in LIKE
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

200 Posts

Posted - 03/05/2013 :  10:21:37  Show Profile  Reply with Quote
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?


Flowing Fount of Yak Knowledge

2875 Posts

Posted - 03/05/2013 :  10:30:24  Show Profile  Reply with Quote
You need to escape the brackets

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


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

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 03/05/2013 :  10:33:33  Show Profile  Reply with Quote

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000