<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.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>Anthony Brown</title><link>http://sqlblogcasts.com/blogs/antxxxx/default.aspx</link><description>various sql server stuff</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>script to find out what a spid is doing</title><link>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/30/script-to-find-out-what-a-spid-is-doing.aspx</link><pubDate>Thu, 30 Nov 2006 13:43:00 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:1449</guid><dc:creator>antxxxx</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/antxxxx/rsscomments.aspx?PostID=1449</wfw:commentRss><comments>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/30/script-to-find-out-what-a-spid-is-doing.aspx#comments</comments><description>&lt;p&gt;If a server is behaving badly, or there is a long running process and you want to find out what it is actually doing, you might find these scripts useful. They can be used to show the query or stored procedure that is executing and the text of the statement that is executing within that procedure.&lt;/p&gt;&lt;p&gt;This gives a more complete picture of what is happening than by just using dbcc inputbuffer which&amp;nbsp; just displays the last statement sent by the client to sql server.&lt;/p&gt;&lt;p&gt;For example say have a stored procedure, uspProcedure1, which calls another procedure, uspProcedure2, inside it, and uspProcedure2 takes a long time to complete. If a client executes uspProcedure1 and you run dbcc inputbuffer on that spid, it will just show uspProcedure1 executing, even though the statement currently executing is in uspProcedure2&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Both scripts create a procedure which does the same thing - sp_dba_showline is for sql 2000 with sp3 or greater installed and sp_dba_showline2005 is for sql 2005. The reason for the difference is the sql 2000 version uses fn_get_sql (a function introduced in sp3) which is being depreciated in favor of sys.dm_exec_sql_text (available in sql 2005). The sql 2005 version also uses a cross apply join to get the data.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The procedure takes 1 parameter, @spid, and the results returned are:&lt;/p&gt;&lt;p&gt;the results of dbcc inputbuffer to see what query or procedure was called from the client&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the results of sp_who2 to show general process information&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the first 100 lines of the procedure or query being executed (this can be useful to find the procedure name being executed)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the text of the statement actually being executed.&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you create these on the master database as dbo, then they should be accessible from all user database &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1449" width="1" height="1"&gt;</description><enclosure url="http://sqlblogcasts.com/blogs/antxxxx/attachment/1449.ashx" length="952" type="application/zip" /><category domain="http://sqlblogcasts.com/blogs/antxxxx/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Running a report against several servers in RS2005</title><link>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/24/running-a-report-against-several-servers-in-rs2005.aspx</link><pubDate>Fri, 24 Nov 2006 14:47:00 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:1412</guid><dc:creator>antxxxx</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/antxxxx/rsscomments.aspx?PostID=1412</wfw:commentRss><comments>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/24/running-a-report-against-several-servers-in-rs2005.aspx#comments</comments><description>

&lt;p class="MsoNormal"&gt;Whilst
I was looking at building custom reports in management studio, I finally got
round to looking at reporting services in sql 2005.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;



&lt;p class="MsoNormal"&gt;One
really neat feature I found is the ability to use an expression to build a
connection string. Using this, you can dynamically set which server the report connects to when it runs. You
can then embed this report as a subreport on another report and so get it to
run against several servers all from one report. If you look after several
servers, this can give you a nice easy way to check all your servers are OK.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;To
do this, first create the report you want to run against each server. Don't
worry about the data source while you are designing it - just connect to any
machine and make sure it is designed how want.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;When
you are happy with it, add a parameter to the report called ServerName. This
should be a string datatype and the ‘allow blank value’ checkbox should be
unchecked.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Next
you need to change the datasource to use an expression.(one thing to note is
you can’t use an expression on a shared datasource, so you may need to create a
new datasource for the report). Edit the datasource and click the fx button
next to the connection string and change the expression to&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span style="font-size:10pt;font-family:'Courier New';"&gt;=&lt;span style="color:maroon;"&gt;"Data
Source="&lt;/span&gt; &amp;amp; Parameters!ServerName.Value&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;If
you now try and preview the report, you need to enter the servername parameter
and it runs against whichever server you specify.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;p class="MsoNormal"&gt;Now
for the second report. First create a dataset that will return all the names of
the servers you want to run the report against.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;p class="MsoNormal"&gt;On
the layout tab, add a table and bind it to that dataset. Then drag a subreport
into the detail part of the table. Right click on the subreport and select
properties and in the subreport drop down box, select the first report you
created. Finally go to the parameters tab and in the parameter name column
select ServerName and in the parameter value column select the column from the
dataset that contains the servername.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;p class="MsoNormal"&gt;In
the download on this entry are couple of reports to show how this all works.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;p class="MsoNormal"&gt;The
first report is SingleServerInfo that just shows some information that it
connects to. You can change which server it connects to using the ServerName
parameter.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;u1:p&gt;&lt;/u1:p&gt;

&lt;p class="MsoNormal"&gt;The
second report is MultipleServerInfo and has a table with SingleServerInfo as
subreport in one of the cells. This means it is called for each server returned
by the dataset on this report (which needs a table called ServerNames which can
be created using the script in the zip file)&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;These reports will only run against sql 2005 servers as they use some of the dynamic management views available on there. However, there is no reason why you cant use this technique to run a report against several sql 2000 servers (or a mixture of versions)&lt;br&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Please make sure you look at the queries these reports run and are happy with them before running the reports against any of your servers.&amp;nbsp;&lt;/p&gt;



&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1412" width="1" height="1"&gt;</description><enclosure url="http://sqlblogcasts.com/blogs/antxxxx/attachment/1412.ashx" length="3874" type="application/x-zip-compressed" /></item><item><title>documentation on custom reports</title><link>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/22/documentation-on-custom-reports.aspx</link><pubDate>Wed, 22 Nov 2006 11:12:00 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:1379</guid><dc:creator>antxxxx</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/antxxxx/rsscomments.aspx?PostID=1379</wfw:commentRss><comments>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/22/documentation-on-custom-reports.aspx#comments</comments><description>&lt;P&gt;Following on from my last post, Microsoft have now published some documentation on creating custom reports in management studio. Its still a draft, but is available at &lt;A href="http://blogs.msdn.com/sqlrem/archive/2006/11/20/custom-reports-in-management-studio.aspx"&gt;http://blogs.msdn.com/sqlrem/archive/2006/11/20/custom-reports-in-management-studio.aspx&lt;/A&gt;&amp;nbsp;if you want to read it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1379" width="1" height="1"&gt;</description></item><item><title>Custom reports in management studio</title><link>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/15/1310.aspx</link><pubDate>Wed, 15 Nov 2006 14:35:00 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:1310</guid><dc:creator>antxxxx</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/antxxxx/rsscomments.aspx?PostID=1310</wfw:commentRss><comments>http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/15/1310.aspx#comments</comments><description>One of the things I really like in sql 2005 is the management reports available from within management studio. In sp2, there is the ability to add your own report. However the documentation seems a bit sparse on how to do this, so here is a quick overview...(&lt;a href="http://sqlblogcasts.com/blogs/antxxxx/archive/2006/11/15/1310.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=1310" width="1" height="1"&gt;</description><enclosure url="http://sqlblogcasts.com/blogs/antxxxx/attachment/1310.ashx" length="1696" type="application/x-zip-compressed" /></item></channel></rss>