Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 27014
  • Total topics 4908
  • Total members 6645
  • Our newest member
    batfinksdad

TOP POSTERS

Using [ and ] in where clause

All problems and developments related to PHP, Ruby on Rails & Co. are discussed and resolved here.
   

Using [ and ] in where clause

Postby silvercover » Mon Nov 09, 2009 11:50 am

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 [TAC_ID]
      ,[TAC_Attr]
      ,[TAC_Val]
  FROM [NTTabDB].[dbo].[TAC_USR]
  WHERE [Global]Passwd =  53505;


What's wrong?
Thanks in advance.
The more I learn, The less I know!
User avatar
silvercover
 
Posts: 6
Joined: Thu Jul 30, 2009 8:44 am
   

   

Re: Using [ and ] in where clause

Postby centered-effect » Mon Nov 30, 2009 10:43 am

This is a just a guess, but wouldn't [Global]Passwd be [Global].Passwd (note the period). If not, what is the table/column name? That should help you there. table.columnName
centered-effect
 
Posts: 6
Joined: Sun May 03, 2009 9:32 am
   


Return to Server-side Scripting



Who is online

Users browsing this forum: No registered users and 1 guest