
5-18 Implement: Making Required Application Changes
If Your Current Version is 4.x or 10.x Adaptive Server Enterprise 11.5
version 10.0 and is now obsolete. Applications that use it receive a
warning message and subqueries no longer return duplicates.
You may have used this option to obtain better performance. Because
of subquery processing changes, you must rewrite your query as a
join if you want duplicates. You should see better performance in
Adaptive Server for these types of queries.
union Limitations
Only 16 subqueries are allowed on one side of a
union. This does not
affect most queries because only 16 tables are allowed within one
query. This only affects a query with more than 16 subqueries where
some of those subqueries have no
from clauses.
Subqueries and NULL Results
Prior to SQL Server 11.x, a correlated expression subquery in the
set
clause of an update returned 0 instead of NULL when there were no
matching rows. SQL Server 11.x correctly returns NULL when there
are no matching rows, and raises an error.
For example, the following trigger tries to update a column that does
not permit NULL values:
update t1
set c1 = (select max(c1)
from inserted where t1.c2 = inserted.c2)
The correct trigger is:
update t1
set c1 = (select isnull(max(c1), 0)
from inserted
where t1.c2 = inserted.c2)
The where clause updates t1.c1 to 0, if the subquery does not return
any correlation values from the outer table t1.
No Subqueries in Updatable Cursors
The following constructs are no longer allowed in the
select statement
of updatable cursors:
• Subquery
•
distinct option
•
group by clause
Comentarios a estos manuales