Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Ambiguous column name 'ID'.

Author  Topic 

ggeorgiou
Starting Member

7 Posts

Posted - 2010-03-08 : 06:56:55
Hi guys,

I have the following SQL, which works fine within SQL server query analyser and can run with no problems.

But when I come to running it within .NET c# I get the following error "Ambiguous column name 'ID'."

SELECT Department.ID, Authority.ID AS AuthorityID, Department.DivisionID, Department.DepartmentName, Department.Abbreviation, Department.EMailAddress, Department.ContactName
FROM Authority RIGHT OUTER JOIN
Division ON Authority.ID = Division.AuthorityID RIGHT OUTER JOIN
Department ON Division.ID = Department.DivisionID
WHERE (ID = @ID)
ORDER BY Department.DepartmentName

Any help would be much appreciated..

Thanks,
George

Sachin.Nand

2937 Posts

Posted - 2010-03-08 : 07:05:50
WHERE (Department.ID = @ID)

PBUH
Go to Top of Page
   

- Advertisement -