Using [ and ] in where clause

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
silvercover
Forum Newbie
Posts: 10
Joined: Thu Sep 20, 2007 10:17 am

Using [ and ] in where clause

Post 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.
Post Reply