You are here: Re: Msg 107, Level 16, State 2, Line 1 « MsSQL Server « IT news, forums, messages
Re: Msg 107, Level 16, State 2, Line 1

Posted by Erland Sommarskog on 02/01/06 10:19

(billdonovan1947@yahoo.com.au) writes:
> I am getting the following error from the query below against SQL
> Server 8.00.2039 (SP4)
>
> Error:
>====
> Server: Msg 107, Level 16, State 2, Line 1
> The column prefix 'd' does not match with a table name or alias name
> used in the query.
>
> Select Statement:
>=============
> select ....
> from trades a,
> gems_product_groups b,
> portfolio_nav_mapping c,
> products d,
> limit_types e
> left outer join gems_prod_trade_mod f on d.product_id =
> f.product_ID
>
> I know this was a known bug in MS-SQL7, but I thought it had been fixed
> in 2000.

Without seeing the entire query, it's difficult to see what might be
wrong, but try rewrite the query to use JOIN syntax throughout:

SELECT ...
FROM trades a
JOIN gems_product_groups b ON ...
JOIN portfolio_nav_mapping c ON ...
JOIN products d ON ...
JOIN limit_types e ON ...
LEFT JOIN gems_prod_trade_mod f on d.product_id = ...






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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация