Comments posted to this topic are about the item Stairway to SQL PowerShell Level 10: Getting data in and out of SQL Server using SQL Server PowerShell
Thanks for another good article in the series.
Mr or Mrs. 500
I have been using this frequently to import data to SQL Server from Powershell.
It works very well with only a few limitations. Definitely worth checking out.
I have never used these techniques to date, but definitely am interested in using PS to at least get data out of SQL Server.
And not to be pedantic, I noticed that the figure referred to as listing 10.5 has no caption. Thank you.
Yes, I use it as well. I used invoke-sqlcmd2 -As DataTable in this case, but I regularly use Out-DataTable for many things. Glad you get use out of it too.
Thanks. I will file a bug on the article to get it fixed. I have a caption in my article, but on the web page it does not. Good eyes.
I kind of stop using invoke-sqlcmd for multi-line scripts due to its unexpected and ugly bug which I mentioned here
I usually have to run long and complex scripts (running quite a few hours during the ETL process) and using invoke-sqlcmd is a nightmare if these scripts break in the middle due to various reasons.
This is just a kind reminder to our sql community.
Hall of Fame
the new SQL Server powershell module, installed by the SSMS 2016 installer, has a parameter/option for Invoke-sqlcmd to output data to a DataTable as well. It's nice, and does save a few steps.
There's other goodness in this module compared to sqlps as well, including much faster script startup times.
The SQLPS PowerShell module referenced in this article is no longer being updated by Microsoft. It has been superseded by the newer SqlServer module. See https://docs.microsoft.com/en-gb/sql/powershell/download-sql-server-ps-module?view=sql-server-2017 for details.
Yes, I know all of these things. Thanks for the posts. These articles were written years ago. I will see if I can get with Red-Gate and get these updated for current state.
Hall of Fame
Sometimes the old stuff is needed, so I hope the new versions get done with this in mind...
I'm currently working on a Windows 7 computer at work, with only Powershell 2.0 on it (phew...as in, not Powershell 1.0).
But it'd sure be nice to use Powershell 3.0+ instead (especially Powershell ISE 3.0).
I'd ask to upgrade it, but we still have Windows Server 2008 (no, not 2008 R2) servers, so... being able to work only in Psh 2.0 is probably still a useful skill for me to work in if I write scripts that might deploy on those servers.
So it goes.
It's even more interesting working with Oracle & Powershell along with either the MS or old Oracle ADO libraries...
Thank you for your original postings, btw.
Viewing 11 posts - 1 through 10 (of 10 total)