Home Forums Programming Powershell Set-based Insert from PoSh to SQL table RE: Set-based Insert from PoSh to SQL table

  • Anything you can do in .NET you can do in PoSH. Lookup Table-valued Parameters, and how to use them to insert sets of data using one in a Stored Procedure. Most if not all of the examples will be in C# or VB.net, but like I said, you can port that code to PoSH. TVPs or the .NET class SqlBulkCopy are the two best ways I know of to insert batches of data from memory directly into SQL Server. If you write the data to disk that opens up all the bulk load methods of course, like bcp, BULK INSERT, SSIS, etc.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato