What could this sql error message mean? Error: Column name appears more than once in the result column list

I have added a column to several tables, and I populate the column using a couple of stored procedures in a huge import process. I am getting this error returned when I run the main stored procedure. I can run all of my individual stored procedures which are called once for each table where the column is located. I don't get this error. Can anyone give me an idea on what the error means. I am sorry I can't be more specific but the process is very long and complicated.


Sue
Sue_WAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ivanovnCommented:
You have multiple tables that contain a column with the same name and there exists a query that is pulling the data from those tables therefore getting confused in column names.

For example I believe the following scenario would generate that error:

"table1" has two columns named "id" and "name"
"table2" has two columns named "id" and "description"

If you do:
SELECT id FROM table1, table2 WHERE name=description
it might throw that error. I haven't tested that, but I think that is the case. Check your added column name and see if it causes this kind of case in your code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SjoerdVerweijCommented:
You probably have a select with a * in there. Specify the columns.

E.g.

Instead of

Select T1.*, T2.*
From ...

do

Select T1.Col1, T1.Col2, T1.Col3...

This happens because T1 and T2 have a column with the same name.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.