Windows PowerShell 3.0 cmdlet:
get-winevent -FilterXPath “*[System[(Level=1 or Level=2)]]” -MaxEvents 10
February 21, 2013
Gather last 10 Error & critical events from all Windows Event Logs
January 25, 2013
Complete SSMS is available for free in SQL 2012 SP1
In SQL 2012 SP1, Full SSMS is available as a free download.
You can download SSMS (SQL 2012 SP1) from http://www.microsoft.com/en-us/download/details.aspx?id=29062
January 7, 2013
Multi-server results options to merge results
You could set the Multi Server results Options Merge Results = “False” and rerun the same query. Now you will see multiple result sets. This could help you isolate the issue why the result schema returned by specific server is not the same as other result sets. ( Related forum thread: http://social.msdn.microsoft.com/Forums/en-US/sqlkjappmsmgmt/thread/c4cda4bc-7b4d-4367-99a9-3268d8196feb/ )
in SSMS -> Tools -> Options
Query results
-> SQL Server
———> Multi Server Results
Screenshot:
December 30, 2012
2012 in review
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
600 people reached the top of Mt. Everest in 2012. This blog got about 9,500 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 16 years to get that many views.
April 13, 2012
SQL 2012 Developer edition for MSDN subscribers
You can download SQL 2012 Developer edition if you are a MSDN subscriber
April 6, 2012
Export the query to excel sheet automatically
You can use powershell to export query results to a Excel file. You can download script from QueryResultsToExcel.ps1
running the powershell script:
View Excel file:
April 4, 2012
Run multiple SQL script files using Invoke-SqlCmd ( SQL Powershell)
# Right click on Server in Object Explorer ( SQL Management Studio)
# Select Start Powershell, In Powershell window, type in following command. replace c:\sqlscripts with your own folder
dir C:\sqlscripts\*.sql | foreach-object { invoke-sqlcmd -InputFile $_.FullName }
March 6, 2012
Execute multiple scripts at Once
You can use SQL Powershell’s invoke-sqlcmd to run multiple sql script files at once. Related thread: http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/44eefaa7-bd02-48fb-9578-b120a8f49813
January 9, 2012
December 31, 2011
2011 in review
The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.
Here’s an excerpt:
A San Francisco cable car holds 60 people. This blog was viewed about 1,700 times in 2011. If it were a cable car, it would take about 28 trips to carry that many people.







