Skip to main content
added 55 characters in body
Source Link
Colin 't Hart
  • 9.4k
  • 15
  • 36
  • 44

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

 ambiguous column name SucNo

ambiguous column name SucNo

Here is my query:

  SELECT
   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

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:

  SELECT 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

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:

 SELECT
   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
Tweeted twitter.com/#!/StackDBAs/status/145962039184076800
Source Link
Cell-o
  • 1.1k
  • 8
  • 21
  • 40

SQL Server 2000 query error

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:

  SELECT 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