
5-14 Implement: Making Required Application Changes
If Your Current Version is 4.x Adaptive Server Enterprise 11.5
In version 4.x, SQL Server switched expr2 and expr3 automatically at
compile time if it knew that expr2 was greater than expr3. In other
words, it would process “250 between 400 and 200” as though it were
the same as “250 between 200 and 400”
As of version 10.0, SQL Server processes such inverted statements as
“false”.
Here is an example that compares releases:
create table demo (id int)
insert into demo values (250)
select id from demo
where id between 400 and 200
ANSI Comments
ANSI comments start with two or more consecutive hyphens
(-- ). They terminate in a new line. SQL Server adopted this
convention in 10.0. This may cause come current applications to
break if they contain syntax such as:
select 5--2
To avoid this problem, Rewrite these types of expressions with either
of the following:
• Parentheses
select 5 - (-2)
• Extra spaces
select 5 - -2
Correlation Names
ANSI requires correlation names on self-joins. The following query is
now invalid:
select columns from table1, table1
where clause ...
This query must be rewritten as:
Release 4.x
Results
Release 10.x and 11.x
Results
250 no rows returned
Comentarios a estos manuales