all groups > sql server (alternate) > june 2005 >
You're in the

sql server (alternate)

group:

MS SQL 7 and 2000



MS SQL 7 and 2000 kingk436
6/29/2005 2:50:32 PM
sql server (alternate): Does anyone know of any differences between queries in SQL 7 and SQL
2000? I have a collegue that says there could be "subtle" differences
in the output, though I cannot find any documentation of this. Any
link to prove him wrong would be very helpful. Thanks.
Re: MS SQL 7 and 2000 Erland Sommarskog
6/29/2005 9:59:58 PM
kingk436 (development@circuitmap.com) writes:
[quoted text, click to view]

One "subtle" difference is the rule for auto-conversion of data types.
In SQL 2000, conversion is done from a type hierarchy, whereas SQL 7
tries to first convert a constant.

This can differences if you have things like:

SELECT * FROM tbl where varcharcol > 1

In SQL 7, the 1 will be converted to a string, where as in SQL 2000
varcharcol will be converted to an integer. (And thus the query will
fail if there are values in the column that cannot be converted to
integer.)


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
Re: MS SQL 7 and 2000 Greg D. Moore (Strider)
7/4/2005 9:30:23 PM

[quoted text, click to view]

In addition I believe that without an order by, results returned will be
different. (Of course the order shouldn't be specified, but I believe both
SQL 7.0 and 2000 do default to some underlying physical order, but each
differently from the other.)


[quoted text, click to view]

Re: MS SQL 7 and 2000 Erland Sommarskog
7/4/2005 10:01:06 PM
Greg D. Moore (Strider) (mooregr_deleteth1s@greenms.com) writes:
[quoted text, click to view]

Well, without any ORDER BY you could get different results from the
same server running SQL 7 or later depending on the phase of the moon,
availble CPUs if there are parallel streams, etc.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
AddThis Social Bookmark Button