<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PowerShell to fetch a SQL Execution Plan</title><link>http://sqlblog.com/blogs/rob_farley/archive/2010/12/07/powershell-to-fetch-a-sql-execution-plan.aspx</link><description>With PowerShell becoming the scripting language of choice for many people, I’ve occasionally wondered about using it to analyse execution plans. After all, an execution plan is just XML, and PowerShell is just one tool which will very easily handle xml.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: PowerShell to fetch a SQL Execution Plan</title><link>http://sqlblog.com/blogs/rob_farley/archive/2010/12/07/powershell-to-fetch-a-sql-execution-plan.aspx#31396</link><pubDate>Tue, 07 Dec 2010 01:31:35 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31396</guid><dc:creator>SQLvariant</dc:creator><description>&lt;p&gt;This is Excellent Rob. &amp;nbsp;Thanks for throwing it together!!&lt;/p&gt;
</description></item><item><title>Using SQL Execution Plans to discover the Swedish alphabet</title><link>http://sqlblog.com/blogs/rob_farley/archive/2010/12/07/powershell-to-fetch-a-sql-execution-plan.aspx#32238</link><pubDate>Mon, 03 Jan 2011 05:55:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:32238</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;SQL Server is quite remarkable in a bunch of ways. In this post, I’m using the way that the Query Optimizer&lt;/p&gt;
</description></item><item><title>re: PowerShell to fetch a SQL Execution Plan</title><link>http://sqlblog.com/blogs/rob_farley/archive/2010/12/07/powershell-to-fetch-a-sql-execution-plan.aspx#45934</link><pubDate>Sun, 04 Nov 2012 16:11:57 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45934</guid><dc:creator>juerg</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;thanks for the script, however e.g. trying to get the plan for AdventureWorks2012.dbo.uspGetBillOfMaterials I get&lt;/p&gt;
&lt;p&gt;Error: &amp;quot;Unexpected end of file has occurre&lt;/p&gt;
&lt;p&gt;d. The following elements are not closed: OutputList, RelOp, QueryPlan, StmtSimple, Statements, Stor&lt;/p&gt;
&lt;p&gt;edProc, StmtSimple, Statements, Batch, BatchSequence, ShowPlanXML. Line 1, position 4001.&amp;quot;&lt;/p&gt;
&lt;p&gt;At D:\Projekte\Wincasa\QVReporting_home\CreateExecutionPlan.ps1:6 char:109&lt;/p&gt;
&lt;p&gt;+ { return ([xml] (invoke-sqlcmd -Server $server -Database $db -Query &amp;quot;set showplan_xml on;`ngo`n$qu&lt;/p&gt;
&lt;p&gt;ery&amp;quot;).Item &amp;lt;&amp;lt;&amp;lt;&amp;lt; ( 0)) }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: NotSpecified: (:) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : RuntimeException&lt;/p&gt;
&lt;p&gt;any idea?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>re: PowerShell to fetch a SQL Execution Plan</title><link>http://sqlblog.com/blogs/rob_farley/archive/2010/12/07/powershell-to-fetch-a-sql-execution-plan.aspx#46128</link><pubDate>Tue, 13 Nov 2012 10:46:32 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:46128</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;Hi juerg,&lt;/p&gt;
&lt;p&gt;Make sure the file contains the right combinations of brackets, braces and parentheses, and has no extra characters in there.&lt;/p&gt;
&lt;p&gt;Rob&lt;/p&gt;
</description></item></channel></rss>