Page 1 of 1

Using [ and ] in where clause

Posted: Mon Nov 09, 2009 8:58 am
by silvercover
Hi,

I need to select some rows from my MSSQL database where some of my field names have [ and ] chars in their names. so when I want to post my query SQL Server says this:
An expression of non-boolean type specified in a context where a condition is expected, near 'Passwd'.

Here is my SQL query:

Code: Select all

Select all
    SELECT [TAC_ID]
          ,[TAC_Attr]
          ,[TAC_Val]
      FROM [NTTabDB].[dbo].[TAC_USR]
      WHERE [Global]Passwd =  53505;
 


What's wrong?
Thanks in advance.