• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1093
  • Last Modified:

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.

2 Solutions
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.
You probably have a select with a * in there. Specify the columns.


Instead of

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


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

This happens because T1 and T2 have a column with the same name.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now