+ Reply to Thread
Results 1 to 2 of 2

Thread: escape [ in sql-server

  1. #1

    escape [ in sql-server

    I need to escape [ in an sql query for SQL Server
    Code:
    select * from sometable where name like '[something]';
    I actually am looking for a [ before something and I don't want it to act like a wildcard. I tried :
    Code:
    select * from sometable where name like ''[something]';
    But i get that error message :
    Code:
    Unclosed quotation mark after the character string ';

  2. #2
    You can use:
    Code:
    select * from sometable where name like '[[]something[]]';

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts