• Jeff Moden (10/20/2014)


    Gazareth (10/20/2014)


    Yep, just use a UNC path - \\servername\... instead of the local path.

    It's a bit more work to insert into a SQL table but thought you could do a speed test first to see if it's feasible performance-wise.

    There's an article on this site which will help, it's actually very close to what you're doing so may not need much modification:

    http://www.sqlservercentral.com/blogs/nycnet/2013/05/24/performing-an-insert-from-a-powershell-script/

    That script inserts row by row, but I'd recommend trying the insert row-by-row and all at once to see if there's a performance difference.

    Heh... I'm definitely a neophyte when it comes to PoSH. After all this time looking, someone finally came up with a good way to do this using PoSH. The neat thing is, it can all be done auto-magically by calling PoSH from xp_CmdShell. I can't speak for the OP but this certainly will satisfy my requirements. Thank you for your example code and the link.

    You're very welcome Jeff!