locked
Dynamic SQL for two table comparision RRS feed

  • Question

  • Hello experts,

    I have two tables.

    Table A has exact same column names as table B.

    I need my out put like this.

    ID(common for both tables)      TableA.col1  TableB.col1  TableA.col2  TableB.col2 ...............for all columns

    How can i write it in dynamic sql as i have 100 tables to cmpare.

    TIA

    • Moved by Dave PatrickMVP Tuesday, December 22, 2020 7:28 PM looking for forum
    • Changed type Dave PatrickMVP Tuesday, December 22, 2020 7:28 PM question
    Tuesday, December 22, 2020 7:26 PM

Answers

  • I'd try asking for help over here.

    sql-server-general - Microsoft Q&A

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    • Proposed as answer by KHURRAM RAHIM Wednesday, December 23, 2020 6:49 AM
    • Marked as answer by Dave PatrickMVP Wednesday, December 30, 2020 9:40 PM
    Tuesday, December 22, 2020 7:28 PM