<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   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/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Addicted2AX / Addicted2SQL - SQL Server</title>
    <link>http://addicted2ax.de/</link>
    <description>My daily struggle with Dynamics AX &amp; SQL Server</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <pubDate>Thu, 22 Mar 2012 18:15:09 GMT</pubDate>

    <image>
        <url>http://addicted2ax.de/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Addicted2AX / Addicted2SQL - SQL Server - My daily struggle with Dynamics AX &amp; SQL Server</title>
        <link>http://addicted2ax.de/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Dynamics AX 2012 &amp; SQL Server 2008R2: Cross Join vs. Inner Join – Houston we have *NO* Problem</title>
    <link>http://addicted2ax.de/index.php?/archives/22-Dynamics-AX-2012-SQL-Server-2008R2-Cross-Join-vs.-Inner-Join-Houston-we-have-NO-Problem.html</link>
            <category>Performance</category>
            <category>Performance</category>
    
    <comments>http://addicted2ax.de/index.php?/archives/22-Dynamics-AX-2012-SQL-Server-2008R2-Cross-Join-vs.-Inner-Join-Houston-we-have-NO-Problem.html#comments</comments>
    <wfw:comment>http://addicted2ax.de/wfwcomment.php?cid=22</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://addicted2ax.de/rss.php?version=2.0&amp;type=comments&amp;cid=22</wfw:commentRss>
    

    <author>nospam@example.com (Addicted2AX)</author>
    <content:encoded>
    Recently I had to bulid a rather complex list page. The Dynamics AX 2012-query contained some INNER JOINS and some OUTER JOINS between tables. After finishing designing the list page the performance when running the list page was suboptimal.&lt;br /&gt;
 &lt;br /&gt;
After adding some indexes performance increased drastic but still had some room for improvement.&lt;br /&gt;
&lt;br /&gt;
So I ran an SQL Server Profiler Trace and was a little bit shocked for a moment: The SQL statement which was created Dynamics AX 2012  to be send to SQL Server 2008 R2 was a CROSS JOIN with a WHERE-clause and not an INNER JOIN.&lt;br /&gt;
&lt;br /&gt;
First thought was that I remembered that a CROSS JOIN creates a cartesian product of both tables. Cartesian product means that every of the first table is joined with every row of the second table. Then I remebered that a CROSS JOIN with a WHERE-clause delivers in the end the same result as an INNER JOIN.&lt;br /&gt;
Second though was that in other RDBMS and older versions of SQL Server even when the result is the same like in an INNER JOIN a CROSS JOIN with a WHERE-Clause may perform not as good as an INNER JOIN.&lt;br /&gt;
&lt;br /&gt;
So my idea was to check if there is maybe a performance problem in Dynamics AX 2012 by using CROSS JOINS instead of using INNER JOINS.&lt;br /&gt;
Firstly I bulid a query using SalesTable-table joined with SalesLine-table using an INNER JOIN as join mode and as fetch mode “1:n”. I have also tested “1:1”. Ressults were identically.&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;723&quot; height=&quot;398&quot;  src=&quot;http://addicted2ax.de/uploads/2012-03-13/QueryAX.gif&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
For test purposes I used „forced Literals“ and the following SQL Statement was send to SQL Server by Dynamics AX 2012&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;793&quot; height=&quot;369&quot;  src=&quot;http://addicted2ax.de/uploads/2012-03-13/CrossJoin.gif&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Execution Plan looks quite good: For both tables a „Clustered Index Seek“ was performed. Then both result sets were joined. Finished. Looks quite good to me.&lt;br /&gt;
&lt;br /&gt;
Let’s see what statistics say:&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;620&quot; height=&quot;457&quot;  src=&quot;http://addicted2ax.de/uploads/2012-03-13/CrossJoinStatistics.gif&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
434 logical reads for SalesLine-table and 163 logical reads for SalesTable. CPU-time used: 47ms. Total elapsed time: round about 2 seconds. &lt;br /&gt;
Not bad, but maybe an INNER JOIN performs even better.&lt;br /&gt;
&lt;br /&gt;
The following SQL statement using an INNER JOIN was built by me in the way how I would have built it if I was Dynamics AX 2012.&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;662&quot; height=&quot;400&quot;  src=&quot;http://addicted2ax.de/uploads/2012-03-13/InnerJoin.gif&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
I must confess that I was a little bit surprised that both Execution Plans were identically.&lt;br /&gt;
&lt;br /&gt;
Checking statistics shows the same result: Same numbers of reads for SalesTable-table and SalesLine-table. Differences in CPU-time and in total elapsed time are inside normal fluctuations when running SQL Server. So needed time when running a CROSS JOIN with a WHERE-clause and time needed when running an INNER JOIN can said to be identically.&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;656&quot; height=&quot;474&quot;  src=&quot;http://addicted2ax.de/uploads/2012-03-13/InnerJoinStatistics.gif&quot;  alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
A short Google-search showed the following result. Last version of SQL Server which seemed to perform a CROSS JOIN with a WHERE-clause worse than an INNER JOIN was SQL Server 2000. Since SQL Server 2005 query optimizer treats a CROSS JOIN with a WHERE-clause identically to an INNER JOIN. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Update 22.03.2012:&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
I faced a (minor) problem with a CROSS JOIN with WHERE-clause: I joined two tables in a larger query by using Expression “Relation” with value “Yes” (by setting Expression “Relation” to “Yes” relations are set automatically using the relations specified in Relations-knot of the specific table).&lt;br /&gt;
&lt;br /&gt;
Even so the relation seemed to be set correctly in Dynamics AX 2012 the SQL Statement generated by Dynamics AX 2012 was not generated correctly: Only a CROSS JOIN without a WHERE-clause was generated. So the CROSS JOIN generated a cartesian product with a large amount of data. &lt;br /&gt;
Fastest and proper working solution I found was setting back “Relation” to “No” and rebuilding the relation manually. Manually generated relation has exactly the same values as the automatically generation.&lt;br /&gt;
&lt;br /&gt;
This seems &lt;strong&gt;NOT&lt;/strong&gt; to be a general problem, because the other automatically generated relations between the tables of the query work proper and without any problem. I also had no problem using Expression “Relation” with value “Yes” with other queries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/u&gt; &lt;br /&gt;
When Dynamics AX 2012 generates a CROSS JOIN with a WHERE-clause instead of an INNER JOIN when performing an INNER JOIN: There is no performance gap.&lt;br /&gt;
If you have any with unexpected result sets which may look like a cartesian product check the relations between the tables, kill the existing automatically build relations and rebuild these relations manually. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 13 Mar 2012 21:48:19 +0100</pubDate>
    <guid isPermaLink="false">http://addicted2ax.de/index.php?/archives/22-guid.html</guid>
    <category>cross join</category>
<category>dynamics ax 2012</category>
<category>indexes</category>
<category>inner join</category>
<category>performance</category>
<category>sql server 2000</category>
<category>sql server 2005</category>
<category>sql server 2008r2</category>
<category>where-clause</category>

</item>
<item>
    <title>SQL Server performance-tuning with Instant File Initialization</title>
    <link>http://addicted2ax.de/index.php?/archives/15-SQL-Server-performance-tuning-with-Instant-File-Initialization.html</link>
            <category>Administration</category>
            <category>Administration</category>
    
    <comments>http://addicted2ax.de/index.php?/archives/15-SQL-Server-performance-tuning-with-Instant-File-Initialization.html#comments</comments>
    <wfw:comment>http://addicted2ax.de/wfwcomment.php?cid=15</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://addicted2ax.de/rss.php?version=2.0&amp;type=comments&amp;cid=15</wfw:commentRss>
    

    <author>nospam@example.com (Addicted2AX)</author>
    <content:encoded>
    In fact I was writing a checklist on the topic SQL Server performance tuning with focus on running the Dynamics AX 2012 databases.&lt;br /&gt;
One tip deals with “Instant File Initialization”. Even though there are some articles in the internet about this feature, I have not really found detailed “official” information of Microsoft.&lt;br /&gt;
The questions are: What is Instant File Initialization? How can Instant File Initialization be started? What are its limits? Are the risks?&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;1. Instant File Initialization: theory and practice&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
Standard behavior of SQL Server when &lt;br /&gt;
a. Creating a new Database&lt;br /&gt;
b. Adding a file to a database&lt;br /&gt;
c. File growth (manual and auto-growth)&lt;br /&gt;
d. Restore of database (if it includes database-creation or file growth)&lt;br /&gt;
is that the new allocated space is overwritten by zeros before it can be used by SQL Server.&lt;br /&gt;
&lt;br /&gt;
I have made some tests with a 32bit Developer Edition of SQL Server 2008 R2 on my Intel Core i3 (2x2,13 GHz; 3.2 GB of usable RAM; 2,5 inch notebook-hard disc) Laptop. Results for 64bit systems are comparable. Of course other hardware affects the results in detail. &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;The results:&lt;/u&gt;&lt;br /&gt;
Without enabled Instant File Initialization the creation of a new database with a size of 10 GB took about 4:30 minutes. Raising the database size to 20GB took another 4:30 minutes. &lt;br /&gt;
&lt;br /&gt;
Blocking a productive system for such a period of time can cause some trouble with users and your boss. &lt;br /&gt;
Those are scenarios where Instant File Initialization can help you. &lt;br /&gt;
&lt;br /&gt;
After setting up Instant File Initialization SQL does not overwrite newly allocated space with zeros any longer: Creation of a database with the size of 10GB just took round about 5 seconds. Raising the database size to 20GB took somewhat between 5 and 10 seconds. On a fast server-system with SAN-storage this time span should be even shorter.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;2. Setting up Instant File Initialization:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
Instant File Initialization is not mainly a SQL Server feature. It is an operating system privilege which was established by Microsoft with Windows Server 2003 and Windows XP. Therefore it is also available with Windows Vista, Windows Server 2008 and Windows 7.&lt;br /&gt;
&lt;br /&gt;
To set up Instant File Initialization you have to grant the service account which is running SQL Server the &lt;em&gt;&lt;strong&gt;SE_MANAGE_VOLUME_NAME&lt;/strong&gt;&lt;/em&gt;-privilege. To get this privilege add the SQL Server service account to &lt;strong&gt;&lt;em&gt;Perform Volume Maintenance Tasks&lt;/em&gt;&lt;/strong&gt; security policy. Quite simple, isn’t it?&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Please note:&lt;/u&gt; Just the Professional versions of Windows Vista and Windows Server grand direct access to the group policies. Home Premium versions have not installed the needed tools to edit the polies directly. In these versions you have to edit registry directly. &lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;3. What tasks do not profit of Instant File Initialization?&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
Instant File Initialization does not work with log files. When allocating new space for log files SQL Server is zeroing out the needed space even though Instant File Initialization is enabled.&lt;br /&gt;
According to Paul S. Randal log-files needed to be zeroed out because this is the only way to determine the end of the log-file in case of a crash. &lt;a href=&quot;http://sqlskills.com/BLOGS/PAUL/post/Search-Engine-QA-24-Why-cant-the-transaction-log-use-instant-initialization.aspx&quot;&gt;For more information read his blog-entry.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;4. Are there risks?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
According to some Microsoft blog-entries there seems to be a slight risk. If you are running two or more instances of SQL Server on a computer there could be the risk, that space which was formally allocated to one instance, will be allocated to another instance. With enabled Instant File Initialization this space is not overwritten with zeros. Therefore there is the risk that users of this other instance can read old data of the instance which had formally allocated the space.&lt;br /&gt;
I have spoken to a Microsoft Consultant about this risk. He said, that the risk is mainly of a theoretical nature, because the data extremely hard to read and most time not of a specific order.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;5. Conclusion: &lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
Instant File Initialization can speed up creation of big, new databases or raising the size of an existing database in a significantly. &lt;br /&gt;
Log-flies are not affected by Instant File Initialization, because allocated space of log files needs to be zeroed out by design.&lt;br /&gt;
There is a slight security risk when you run more than one instance of SQL Server but when you can rule out this risc for your data Instant File Initialization is a great feature which can speed up SQL Server significantly.&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 09 Nov 2011 20:51:08 +0100</pubDate>
    <guid isPermaLink="false">http://addicted2ax.de/index.php?/archives/15-guid.html</guid>
    <category>Administration</category>
<category>Instant File Initialization</category>
<category>operation system privilege</category>
<category>Performance Tuning</category>
<category>SQL Server</category>

</item>
<item>
    <title>Problems with SSRS &amp; pdf-export after subsequent installation of fonts</title>
    <link>http://addicted2ax.de/index.php?/archives/14-Problems-with-SSRS-pdf-export-after-subsequent-installation-of-fonts.html</link>
            <category>Installation </category>
            <category>Installation </category>
            <category>Reporting Services</category>
            <category>Reporting Services</category>
    
    <comments>http://addicted2ax.de/index.php?/archives/14-Problems-with-SSRS-pdf-export-after-subsequent-installation-of-fonts.html#comments</comments>
    <wfw:comment>http://addicted2ax.de/wfwcomment.php?cid=14</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://addicted2ax.de/rss.php?version=2.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    

    <author>nospam@example.com (Addicted2AX)</author>
    <content:encoded>
    Today I had to do a subsequent installation of some fonts that were not available on SSRS server after initial installation. &lt;br /&gt;
&lt;br /&gt;
Even though the new fonts were available in Notepad and also worked fine with it, I had some trouble to make the fonts work with reporting services and in reports exported into a pdf-document.&lt;br /&gt;
&lt;br /&gt;
After checking the pdf-document report-layout was totally broken. The reason for that problem was simple: Not the subsequently installed and in the report used font was utilized but another (randomly chosen?) windows font, although the newly installed font was correctly embedded into the pdf-document.&lt;br /&gt;
&lt;br /&gt;
I have restarted the SSRS-services but the problem continued.&lt;br /&gt;
Long story short: I had to reboot the complete Server. After the reboot the problem was gone.&lt;br /&gt;
&lt;br /&gt;
Maybe an obvious solution but the problem was that a lot of consultants and developer worked on that server, so it was bigger trouble to reboot it contemporary.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 19 Oct 2011 19:13:09 +0200</pubDate>
    <guid isPermaLink="false">http://addicted2ax.de/index.php?/archives/14-guid.html</guid>
    <category>fonts</category>
<category>pdf-export</category>
<category>reports</category>
<category>ssrs</category>

</item>
<item>
    <title>Blank, last page in SSRS-Report</title>
    <link>http://addicted2ax.de/index.php?/archives/11-Blank,-last-page-in-SSRS-Report.html</link>
            <category>Reporting Services</category>
            <category>Reporting Services</category>
    
    <comments>http://addicted2ax.de/index.php?/archives/11-Blank,-last-page-in-SSRS-Report.html#comments</comments>
    <wfw:comment>http://addicted2ax.de/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://addicted2ax.de/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>nospam@example.com (Addicted2AX)</author>
    <content:encoded>
    Ok, it took some time but here is a new entry. A short one. &lt;br /&gt;
&lt;br /&gt;
You may face this problem sooner or later, when creating a SSRS-report with  SQL Server 2008. It can happen with both plain Reporting Services and SSRS with Dynamics AX 2012.&lt;br /&gt;
&lt;br /&gt;
After creating a report all looks fine, till you reach the end of the report.  Although the last page with report-data has plenty of space left, there is a last completely empty  - meaning white page – at the end of the report. &lt;br /&gt;
&lt;br /&gt;
With Reporting Services for SQL Server 2005 you did not face this kind of problem, because white spaces are removed automatically. This is not a bug just a changed behavior. &lt;br /&gt;
&lt;br /&gt;
But how to solve this problem with SQL Server 2008?&lt;br /&gt;
Quite simple: Just select the properties of the report. Look for the &lt;strong&gt;&lt;em&gt;ConsumeContainerWhitespace&lt;/em&gt;&lt;/strong&gt;-property. If the value is &lt;em&gt;&lt;strong&gt;FALSE&lt;/strong&gt;&lt;/em&gt; change it to &lt;em&gt;&lt;strong&gt;TRUE&lt;/strong&gt;&lt;/em&gt; and your problem with a last white page in SSRS-reports should be history. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- s9ymdb:17 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;411&quot; height=&quot;328&quot;  src=&quot;http://addicted2ax.de/uploads/2011-09-19/WhiteSpace.jpg&quot; title=&quot;&amp;quot;ConsumeContainerWhitespace&amp;quot;-Property&quot; alt=&quot;&amp;quot;ConsumeContainerWhitespace&amp;quot;-Property&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Tipp: If you have the problem that there is a page with report-data, followed by  a blank one, followed by a page with report data, a blank one and so on, the problem is different but as easy to solve.  Just make sure that &lt;strong&gt;&lt;em&gt;Body Width&lt;/em&gt;&lt;/strong&gt; of the report + &lt;em&gt;&lt;strong&gt;Left margin&lt;/strong&gt;&lt;/em&gt; + &lt;em&gt;&lt;strong&gt;Right margin&lt;/strong&gt;&lt;/em&gt; are together smaller than the &lt;em&gt;&lt;strong&gt;Page Width&lt;/strong&gt;&lt;/em&gt;.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 19 Sep 2011 19:53:22 +0200</pubDate>
    <guid isPermaLink="false">http://addicted2ax.de/index.php?/archives/11-guid.html</guid>
    <category>blank page</category>
<category>ConsumeContainerWhitespace</category>
<category>Dynamics AX 2012</category>
<category>SQL Server 2008</category>
<category>SSRS</category>

</item>
<item>
    <title>Checking the size of a database</title>
    <link>http://addicted2ax.de/index.php?/archives/8-Checking-the-size-of-a-database.html</link>
            <category>Administration</category>
    
    <comments>http://addicted2ax.de/index.php?/archives/8-Checking-the-size-of-a-database.html#comments</comments>
    <wfw:comment>http://addicted2ax.de/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://addicted2ax.de/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>nospam@example.com (Addicted2AX)</author>
    <content:encoded>
    In this post I will show you a quick and easy way to find out how much space a specific database occupies on the hard drive.&lt;br /&gt;
Sure, you can check the properties of the database. But this is neither fast nor convenient.&lt;br /&gt;&lt;br /&gt;
In this case the build-in &lt;i&gt;system stored-procedure&lt;/i&gt; &lt;b&gt;sp_spaceused&lt;/b&gt; is useful.&lt;br /&gt;
Just select the database of interest and type in &lt;b&gt;EXEC sp_spaceused&lt;/b&gt; and you will get a result like this:&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;388&quot; height=&quot;182&quot;  src=&quot;http://addicted2ax.de/uploads/2011-08-02/sp_spaceused.jpg&quot; title=&quot;SQL Server system-procedure &amp;quot;sp_spaceused&amp;quot;&quot; alt=&quot;SQL Server system-procedure &amp;quot;sp_spaceused&amp;quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
The meaning of the columns as following:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;database_name:&lt;/b&gt; The name of the database&lt;br /&gt;
&lt;b&gt;database_size:&lt;/b&gt; The size of the database in Megabytes (including data &amp;amp; logs)&lt;br /&gt;
&lt;b&gt;unallocated space:&lt;/b&gt; Space in database which is not allocated to database-objects&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;reserved:&lt;/b&gt; Total amount of space allocated by objects in the database&lt;br /&gt;
&lt;b&gt;data:&lt;/b&gt; Total amount of space used by data&lt;br /&gt;
&lt;b&gt;index_size: &lt;/b&gt;Total amount of space used by database indexes&lt;br /&gt;
&lt;b&gt;unused:&lt;/b&gt; Reserved for database-objects but not used&lt;br /&gt;
&lt;br /&gt;
Ok, not bad. But what would you do if you need this kind of information for every database on the SQL Server?&lt;br /&gt;
Of course you can execute &lt;b&gt;sp_spaceused&lt;/b&gt; for every database. But this is also not very convenient.&lt;br /&gt;
&lt;br /&gt;
For this kind of job there is another &lt;i&gt;system stored-procedure&lt;/i&gt;. It is undocumented and therefore not officially supported by Microsoft. So please handle it with care.&lt;br /&gt;
&lt;br /&gt;
The name of it is: &lt;strong&gt;sp_MSforeachDB&lt;/strong&gt;.&lt;br /&gt;
Usage: &lt;strong&gt;EXECUTE master.sys.sp_MSforeachDB &#039;USE [?]; EXEC sp_spaceused&#039; &lt;/strong&gt;  &lt;br /&gt;
&lt;br /&gt;
The result would be like this:&lt;br /&gt;
&lt;br /&gt;
&lt;img class=&quot;serendipity_image_center&quot; width=&quot;413&quot; height=&quot;297&quot;  src=&quot;http://addicted2ax.de/uploads/2011-08-02/MSforeachdb.jpg&quot; title=&quot;Undocumented SQL Server system-procedure &amp;quot;sp_MSforeachDB&amp;quot;&quot; alt=&quot;Undocumented SQL Server system-procedure &amp;quot;sp_MSforeachDB&amp;quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
You can perform a lot of other interesting and useful actions on your SQL Server with &lt;strong&gt;sp_MSforeachDB&lt;/strong&gt;. In one of the next posts I will show you some other examples of usage.&lt;br /&gt;
&lt;br /&gt; 
    </content:encoded>

    <pubDate>Tue, 02 Aug 2011 22:21:50 +0200</pubDate>
    <guid isPermaLink="false">http://addicted2ax.de/index.php?/archives/8-guid.html</guid>
    <category>sp_msforeachdb</category>
<category>sp_spaceused</category>
<category>SQL Server</category>
<category>System Stored Procedure</category>
<category>T-SQL</category>

</item>

</channel>
</rss>