Using MERGE with Invoke-SqlCmd

Welcome Forums General PowerShell Q&A Using MERGE with Invoke-SqlCmd

This topic contains 0 replies, has 1 voice, and was last updated by  Joshua Taylor 4 years, 8 months ago.

  • Author
  • #18764

    Topics: 3
    Replies: 12
    Points: 2
    Rank: Member

    Has anyone used MERGE with Invoke-SqlCmd using a PowerShell object as source?

    I'm using Out-DataTable from the Technet repository to format a PS object as a table that can be written to SQL. My script currently uses UPDATE to update the table daily when run, but I'd like to try to use MERGE instead as it would shorten my code considerably. I've been told that MERGE must use an existing SQL table as source and that an object won't work, but I can't confirm this.

    I know there probably aren't many SQL guys on here, but figured it couldn't hurt to ask. 🙂

The topic ‘Using MERGE with Invoke-SqlCmd’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort