BUG: BOL Incorrectly States the Precedence of Bitwise Operators (289287)



The information in this article applies to:

  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q289287
BUG #: 15696 (SQLBUG_70)
BUG #: 352259 (SHILOH)

SYMPTOMS

SQL Server 7.0 and SQL Server 2000 Books Online both state that the bitwise operators ^, &, and | have a lower precedence than the arithmetic operators + and -. This is incorrect; in fact, they are all evaluated at the same level of precedence.

CAUSE

The "Errata" section of the SQL Server 6.5 documentation stated that they were all evaluated at the same level of precedence and for backward compatibility, this had to remain.

WORKAROUND

Use parentheses for more complete control over the order of operation.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0 documentation.
Microsoft has confirmed this to be a problem in SQL Server 2000 documentation.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbBug kbpending KB289287