Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Duplicate column names not allowed in result sets obtained through OPENQUERY and OPENROWSET Expand / Collapse
Author
Message
Posted Thursday, September 5, 2013 2:34 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, September 18, 2014 2:09 PM
Points: 82, Visits: 336
Hi All,

Please I need someone to help me with this problem. I have a table variable which I need to insert data into. The data I want to insert comes from a query for example SELECT r.decode, b.decode FROM Sales. employee. The insert is not working because there's duplicate column name in the select list.

The error is this : "Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name "decode" is a duplicate.

Please I need help

EO

Post #1491947
Posted Thursday, September 5, 2013 2:36 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 5:42 PM
Points: 3,576, Visits: 8,026
Could you alias the column in your query to differentiate both decode columns?


Luis C.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1491949
Posted Thursday, September 5, 2013 2:50 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, September 18, 2014 2:09 PM
Points: 82, Visits: 336
Thanks for your response. I just read about this before you posted it. I will try it in office tomorrow
Post #1491954
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse