SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

sqlpal2007
Posting Yak Master

184 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?

Thanks,
-S

jimf
Flowing Fount of Yak Knowledge

USA
2869 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]].%'


Jim

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

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 03/05/2013 :  10:33:33  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New 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.06 seconds. Powered By: Snitz Forums 2000