Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I attempt to run on the SQL Server 2000 to a query which was developed for SQL Server 2008, I receive the following the error.

ambiguous column name SucNo

Here is my query:

   p.SiraNo, p.SucNo, p.Fail, p.SucAdi, p.SucTarihi, p.Musteki, p.Supheli,
   (select f.AdiSoyadi as Kayıp_Şahıs where f.SucYili = '2011') as Kayıp_Şahıs,
   p.EvrakEksigi, p.EvrakSorumlusu, p.SevkTarihi, p.evrakSevkDurumu,
   p.sucYili as Yıl
 FROM pStationTbl p
 LEFT JOIN kayipTbl f ON p.SucNo = f.SucNo
 WHERE p.SucYili = '2011' 
 ORDER BY CASE evrakSevkDurumu
   When 'Beklemede' Then 1
   WHEN 'İkmal Edildi' Then 2
   Else 3
 End, SucNo DESC
share|improve this question
up vote 3 down vote accepted

You need to qualify SucNo DESC in the ORDER BY i.e. p.SucNo DESC.

Presumably the SQL2000 query processor can't deduce that f.SucNo and p.SucNo resolves to the same sort, whereas SQL2008 can.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.