I've inherited a database with duplicate naming (for example, there's an Item_id field in just about every table). Trying to do joins is a royal pain. Especially since I don't seem to be able to specify WHICH Item_id I want. For example, if there's an Item_id field in Table1 and an Item_id field in Table2 (sometimes they refer to the same ID, sometimes a different one) and I join with SELECT *, I get an error when I try to get the id's like this:
intItemID = objDataReader("Table2.Item_id")
I get the frustrating "IndexOutOfRangeException" error. So, How do I specify which one I want? Am I going to have to go in and do something like:
"SELECT Table1.Item_id AS t1ItemID, Table2.Item_id as t2ItemID..."?
View Complete Post