Ambigous Column Name In SQL Server TSQL Query
If you encounter this error in your TSQL query embedded in C#, you might want to check the table it is being joined. It might be that some field in the other table has the same fieldname.
Example
Orders - status varchar(90)
OrdersSubForm - status varchar(30)
Just make sure, you create a prefix of the table name plus the dot and append it in your field. Just like the example below, for the status field.
Example
Orders - status varchar(90)
OrdersSubForm - status varchar(30)
Just make sure, you create a prefix of the table name plus the dot and append it in your field. Just like the example below, for the status field.
Select Orders.status, OrderNum from Orders right outer join OrderSubForm on OrderSubForm.ID = Orders.ID where (your condition here)
Comments
Post a Comment