|
Posted by Erland Sommarskog on 11/01/05 10:06
Neil (nospam@nospam.net) writes:
> You're saying that SQL 2000 performs implicit conversions, but SQL 7
> doesn't? That seems like a step backwards for MS. I wish Access didn't
> perform implicit conversions.
That step backwards was taken with SQL 7 from SQL 6.5. A few more implicit
conversions were added in SQL 2005.
Of course, sometimes you do want implicit conversions. It's convenient
to have explicit conversions from character to datetime, or from integer
to bit. But from string to number and numbers to string? That's only bad.
This particular case is about an implicit conversion between varchar
and nvarchar. (or char/nchar), which can occur in both SQL 7 and SQL 2000.
What is different are the rules of what is being converted. In SQL 2000
there is a strict data-type precendence, so a type with low precendence is
always converted to a higher. Thus, a varchar value is converted to
nvarchar, since nvarchar is higher up. I don't know the rules for SQL 7,
as I never worked much with this version, but I know they are different,
and it might be that values are converted rather than columns.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|