Re: A Bug about SQL Query Analysis



Lorry Astra wrote:
I found a bug about SQL Query Analysis, if u write a sql statement like this:

SELECT Tmptable.col1
table.col2
FROM TEMPDB..[Table] AS Tmptable
LEFT JOIN table ON Tmptable.ID=table.ID

we should know, this sentence is wrong, 'cos it seems like something wrong
between "Tmptable.col1" and "table.col2", the right formation is "
Tmptable.col1 , table.col2"

but SQL Query Analysis says the sentence that i feel wrong is just right, it
can show a query result based on it. I think it should be a bug.

Plus:
the right sentence should be like this:

SELECT Tmptable.col1 ,
table.col2
FROM TEMPDB..[Table] AS Tmptable
LEFT JOIN table ON Tmptable.ID=table.ID



You haven't told us what version, edition and service pack you are
using. In SQL Server 2000 SP4 and SQL Server 2005 SP1 (both Dev
edition) your first query gives a syntax error:

Server: Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '.'.

(the only modification I made was to bracket the name "table" because
it's a reserved word).


Could any one tell me why? and how to resolve it by patching. Thanks.

http://www.microsoft.com/sql/sp1.mspx
http://www.microsoft.com/downloads/details.aspx?familyid=8E2DFC8D-C20E-4446-99A9-B7F0213F8BC5


--
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
--

.



Relevant Pages

  • Re: CONTAINS performance
    ... That said, and with the query plan, I can start to give you more ... relational join in the context of the free-text optimization, ... SQL Server tables. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Indexing Service, Openquery and sp_executesql
    ... SQL Server version and sp are you running? ... > data from the indexing service catalog when pasted into ... > query analyzer, but failed when put against sp_executesql ... I would choose Microsoft Indexing ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Problem using Access or Query Designer to run queries in SQL Serve
    ... >or Query Designer within Enterprise Manager, it works and I get data back. ... >ODBC Call Failed [ODBC SQL Server Driver] Timeout Expirederror in Access ... >[ODBC SQL Server Driver] Timeout Expired ...
    (microsoft.public.sqlserver.odbc)
  • Re: The Many Flavors of SQL - Can a SQL Server query work in MS Access?
    ... I prefer to specify by name the sort columns, ... query as the source. ... in the Query Analyzer on a Windows 2000 Server box running SQL Server ... but it always erros out with: "Syntax Error ...
    (microsoft.public.access.queries)
  • Extreme performance issues (SQL Server 2000/ADO.NET/C#)
    ... This process runs very quickly if run through Query ... same exact stored procedures and views, run in the same exact order, through ... system that runs SQL Server (a 4-cpu Xeons system with 2gigs of physical ... When I execute these steps manually through query analyser,, ...
    (microsoft.public.dotnet.framework.adonet)