<?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>Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx</link><description>One of the first things I want to do when I look at a new SQL Server is to get an idea of space usage details for each database, including total space usage. For this I have been using my own sp_db_space_usage for a while now, so I decided to add it to</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#20310</link><pubDate>Tue, 29 Dec 2009 12:46:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:20310</guid><dc:creator>Uri Dimant</dc:creator><description>&lt;p&gt;Hi Tibor&lt;/p&gt;
&lt;p&gt;I would add that those numbers are in MB/KB/GB... and /or perhaps the percent usage % or data and log files, what do you think? &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#20354</link><pubDate>Wed, 30 Dec 2009 07:50:09 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:20354</guid><dc:creator>TiborKaraszi</dc:creator><description>&lt;p&gt;Hi Uri,&lt;/p&gt;
&lt;p&gt;I had that originally (MB), but decided to remove it to keep the result as slim as possible... :-)&lt;/p&gt;
</description></item><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#20998</link><pubDate>Wed, 13 Jan 2010 12:33:16 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:20998</guid><dc:creator>csm</dc:creator><description>&lt;p&gt;Hi Tibor,&lt;/p&gt;
&lt;p&gt;there's an error on the definition for #dbcc_sqlperf_logspace table. The datatype for database_name column must be sysname (or something similar), not varchar(32).&lt;/p&gt;
&lt;p&gt;Anyway, thanks for the script&lt;/p&gt;
</description></item><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#21011</link><pubDate>Wed, 13 Jan 2010 16:15:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:21011</guid><dc:creator>TiborKaraszi</dc:creator><description>&lt;p&gt;Hi csm,&lt;/p&gt;
&lt;p&gt;That type (varchar(32) is actually deliberate. It was there for tools which doesn't adjust width according to data size. I.e., so we don't have to scroll that much side-ways when reading the result. I think it had to do with 2000 tool (the proc is supposed to be runnable on 2000), but exact details escapes me at the moment. &lt;/p&gt;
&lt;p&gt;Sysname would be the type to use if you don't want to truncate long db name - that is correct. :-)&lt;/p&gt;
</description></item><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#21135</link><pubDate>Mon, 18 Jan 2010 08:53:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:21135</guid><dc:creator>csm</dc:creator><description>&lt;p&gt;But with 32 characters only, the procedure raise an exception (i.e., the AdminContent database in a Sharepoint implementation)&lt;/p&gt;
</description></item><item><title>re: Util procedure to show database size</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/29/util-procedure-to-show-database-size.aspx#21198</link><pubDate>Tue, 19 Jan 2010 16:29:58 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:21198</guid><dc:creator>TiborKaraszi</dc:creator><description>&lt;p&gt;You are absolutely right. I guess I only tested it with db names shorter than 32, in order for the tool to not have a too wide column. I now tested it with a long db name and I get the same truncation messaged. I fixed that datatype, changed it to sysname. The &amp;quot;right&amp;quot; way to cut down the length would have been to use CAST or CONVERT on the final select instead of having a smaller type in the input table...&lt;/p&gt;
</description></item></channel></rss>