[dba-SQLServer] SQL Server - Turning comparisons into Booleans

Arthur Fuller fuller.artful at gmail.com
Tue May 8 12:34:45 CDT 2007


Let's pick it apart tad by tad, beginning with your denigrating use of
"infamous". This is a "famous" error, not an infamous error. For references
to infamous errors, their numbers are 533 and 601.

Now. Let's go step by step.AFAIK S2k5 has no issues with square brackets, in
fact I use them frequently, but begin by removing them.

Step 2: Why is there no space between the value and the operator? I shall
assume that it's the fault of the translator.

Step 3: lose the "AS" part and run the query and see what happens. You
probably won't get this far, since Steps 1 and 2 ought to fix the problem,
but JIC (just in case).

Step 4: when none of the above works, re-do the query in Management Studio.
Then compare the syntax.

A,

On 5/8/07, JWColby <jwcolby at colbyconsulting.com> wrote:
>
> In Access you can do something like:
>
> MyAlias: [SomeField] <=10
>
> Which translates into SQL that looks like:
>
> [SomeField]<=10 as MyAlias
>
> When I try move that (cut and paste) from Access into SQL Server I get a
> the
> infamous "syntax error somewhere near <"
>
> Question 1:  What is wrong with that in SQL Server
> Question 2: How do I accomplish this directly in the query builder in SQL
> Server?
>
> John W. Colby
> Colby Consulting
> www.ColbyConsulting.com
>



More information about the dba-SQLServer mailing list