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: Wednesday, July 9, 2014 9:51 AM
Points: 80, Visits: 332
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: Today @ 2:34 PM
Points: 3,342, Visits: 7,210
Could you alias the column in your query to differentiate both decode columns?


Luis C.
I am a great believer in luck, and I find the harder I work the more I have of it. Stephen Leacock

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: Wednesday, July 9, 2014 9:51 AM
Points: 80, Visits: 332
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