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 2000 Forums
 SQL Server Development (2000)
 Column of a different name

Author  Topic 

hubschrauber
Starting Member

16 Posts

Posted - 2006-03-14 : 10:36:59
I get the following error and I don't know how to solve it:

Duplicate column name resolution could not be done because the oridinal specified a column of a different name

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-14 : 10:44:42
Post your SQL..
Go to Top of Page

hubschrauber
Starting Member

16 Posts

Posted - 2006-03-14 : 11:10:11
select * from u_tbl_gefuith_uitsw_openstaand_nw_deze_week
inner join s_tbl_rswim_berichten_08x_09x on
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.switchid = s_tbl_rswim_berichten_08x_09x.processidech
where msgtypeid ='1095' and
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.itemtype is null
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-14 : 11:18:47
Do u have
switchid column in u_tbl_gefuith_uitsw_openstaand_nw_deze_week table ?
itemtype column in u_tbl_gefuith_uitsw_openstaand_nw_deze_week table ?

processidech column in u_tbl_gefuith_uitsw_openstaand_nw_deze_week table ?

msgtypeid name in only 1 table ?
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-14 : 11:21:37
Do you have a column with the same name in both tables? Also, which table is msgtypeid in?

Also, try using alias'

select * from u_tbl_gefuith_uitsw_openstaand_nw_deze_week ndw
inner join s_tbl_rswim_berichten_08x_09x rb on
ndw.switchid = rb.processidech
where msgtypeid ='1095' and
ndw.itemtype is null
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-03-14 : 12:01:08
I know it's a foreign language, and I'm sure it's not gibberish if you understand that language, but

"u_tbl_gefuith_uitsw_openstaand_nw_deze_week"

is one of the longest table names I've ever seen. Yikes!

Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-14 : 12:15:00
For the longest column name c the answer in the bottom of the following thread
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=63090
Go to Top of Page

hubschrauber
Starting Member

16 Posts

Posted - 2006-03-14 : 12:25:58
I have changed it and I have all the column names, the query parsed succesfull so the excisting of the column names is not the problem

select * from u_tbl_gefuith_uitsw_openstaand_nw_deze_week
inner join s_tbl_rswim_berichten_08x_09x on
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.switchid = s_tbl_rswim_berichten_08x_09x.processidech
where s_tbl_rswim_berichten_08x_09x.msgtypeid ='1095' and
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.itemtype is null
Go to Top of Page

hubschrauber
Starting Member

16 Posts

Posted - 2006-03-14 : 12:28:14
It works in the sql query analyzer, but it doesn't work in the DTS
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-14 : 12:33:46
Aliasing really is the way to go for you, how about if you list the column names you want instead of using *?

A quick way to do this is to:


select 'ndw' + column_name + ',' from information_schema.columns where table_name = 'u_tbl_gefuith_uitsw_openstaand_nw_deze_week' order by ordinal_position

then do this for the other table and take the last comma off..

Go to Top of Page

hubschrauber
Starting Member

16 Posts

Posted - 2006-03-15 : 05:11:36
I have sloved the problem....like this

select u_tbl_gefuith_uitsw_openstaand_nw_deze_week.*, s_tbl_rswim_berichten_08x_09x.msgtypeid as bericht
from u_tbl_gefuith_uitsw_openstaand_nw_deze_week CROSS
join s_tbl_rswim_berichten_08x_09x
where msgtypeid ='1095' and
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.itemtype is null
and
u_tbl_gefuith_uitsw_openstaand_nw_deze_week.switchid = s_tbl_rswim_berichten_08x_09x.processidech
Go to Top of Page
   

- Advertisement -