Tagged: SSMS

SQL Server Management Studio

0

Searching SQL Servers & Saving Results, with Write-SqlTableData

The other day I was chatting with my friend Tom Roush ( B | T ) and he mentioned needing to scan every database on every SQL Server instance in his environment and look for a particular word in the stored procs. Tom and I had discussed basics of his environment once before so I knew he already had Registered Servers filled out with all the instances he was going to need to search.

Write-SqlTableData came out last month in SSMS 16.4, it’s V1 so it’s not perfect [yet] but boy is it ever magic when you’re in a hurry! In this case, in order to be able to save the results for Tom, we need to find what we’re looking for once and then create a table in SQL Server using those results. To do this we use our very much improved friend Invoke-Sqlcmd and we leverage the new -OutputAs DataTables parameter which came out earlier this year. That give us a .Net Data Table.

Want to get something fixed/improved/added in SQL Server Management Studio? Join us on Trello! 1

Want to get something fixed/improved/added in SQL Server Management Studio? Join us on Trello!

Do you have something you want to get fixed, improved, or added in SQL Server Management Studio?  If so, join us on Trello! A couple weeks ago I mentioned that we are using Trello...

Performance Tweaking Your SQL Server via PowerShell and Other News 1

Performance Tweaking Your SQL Server via PowerShell and Other News

Wow, there’s so much PowerShell news and goings-on that I barely have time to update the blog.  Here is a very terse update of some of what’s going on. Thank you to all of...

1

SQLServer:\SQL\Databases\Tables> Dir

Update 2016-07-01: If you are using SSMS 2012 or SSMS 2014 you will need to run Import-Module SQLPS to load the SQL Server PowerShell Provider. If you are using SSMS 2016 specifically SSMS 16.3+...