Duplicate column names not allowed in result sets obtained through OPENQUERY and OPENROWSET

  • 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

  • Could you alias the column in your query to differentiate both decode columns?

    Luis C.
    General Disclaimer:
    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?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Thanks for your response. I just read about this before you posted it. I will try it in office tomorrow

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply