Re: A Bug about SQL Query Analysis(SQL 2000 AND SQL Server 2005)
- From: "David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx>
- Date: 3 Jul 2006 23:43:03 -0700
That's a bit different to your original example. There is no bug here.
In the following query:
SELECT
Lorry.id
cinvcode
FROM TempDB..[Lorry1] AS TmpTotal
LEFT JOIN Lorry ON TmpTotal.id=Lorry.id
cinvcode is correctly interpreted as an *alias* for the column Lorry.id
therefore the query is perfectly legal in standard SQL syntax. It's
equivalent to:
SELECT Lorry.id AS cinvcode
FROM TempDB..[Lorry1] AS TmpTotal
LEFT JOIN Lorry ON TmpTotal.id=Lorry.id
The AS keyword is optional.
Having said that, you are still using the RTM version of SQL Server
2000 so I strongly recommend you upgrade it.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
.
- References:
- Re: A Bug about SQL Query Analysis
- From: David Portas
- Re: A Bug about SQL Query Analysis(SQL 2000 AND SQL Server 2005)
- From: Lorry Astra
- Re: A Bug about SQL Query Analysis
- Prev by Date: Re: A Bug about SQL Query Analysis(SQL 2000 AND SQL Server 2005)
- Next by Date: Re: null character
- Previous by thread: Re: A Bug about SQL Query Analysis(SQL 2000 AND SQL Server 2005)
- Next by thread: Re: null character
- Index(es):
Relevant Pages
|
|