<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Find Current Location of Data and Log File of All the Database</title>
	<atom:link href="http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Mon, 13 Feb 2012 15:11:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-128938</link>
		<dc:creator><![CDATA[SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed Journey to SQLAuthority]]></dc:creator>
		<pubDate>Fri, 15 Apr 2011 01:31:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-128938</guid>
		<description><![CDATA[[...] quickly searched on the Internet and I ended up on a very interesting blog post written by me SQL SERVER – Find Current Location of Data and Log File of All the Database. I have previously written how I can find the location of all the files of the [...]]]></description>
		<content:encoded><![CDATA[<p>[...] quickly searched on the Internet and I ended up on a very interesting blog post written by me SQL SERVER – Find Current Location of Data and Log File of All the Database. I have previously written how I can find the location of all the files of the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phillby11</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-128149</link>
		<dc:creator><![CDATA[Phillby11]]></dc:creator>
		<pubDate>Sun, 10 Apr 2011 22:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-128149</guid>
		<description><![CDATA[To achieve the same result in SQL 2000

SELECT name, filename AS current_file_location
FROM master..sysdatabases]]></description>
		<content:encoded><![CDATA[<p>To achieve the same result in SQL 2000</p>
<p>SELECT name, filename AS current_file_location<br />
FROM master..sysdatabases</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-114068</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 25 Jan 2011 09:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-114068</guid>
		<description><![CDATA[Make use of this post
http://beyondrelational.com/blogs/madhivanan/archive/2009/05/07/how-to-find-size-of-backup-files-in-a-folder.aspx]]></description>
		<content:encoded><![CDATA[<p>Make use of this post<br />
<a href="http://beyondrelational.com/blogs/madhivanan/archive/2009/05/07/how-to-find-size-of-backup-files-in-a-folder.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2009/05/07/how-to-find-size-of-backup-files-in-a-folder.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaheb</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-114004</link>
		<dc:creator><![CDATA[Shaheb]]></dc:creator>
		<pubDate>Tue, 25 Jan 2011 07:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-114004</guid>
		<description><![CDATA[Hi Panal,
I want a list of .mdf and .ldf filename,size,location and  date modifed through query analyzer same as we check in the drive.how to write a T-Sql to get this information.
Thanks in advance
Shahab]]></description>
		<content:encoded><![CDATA[<p>Hi Panal,<br />
I want a list of .mdf and .ldf filename,size,location and  date modifed through query analyzer same as we check in the drive.how to write a T-Sql to get this information.<br />
Thanks in advance<br />
Shahab</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alba Henning</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-110659</link>
		<dc:creator><![CDATA[Alba Henning]]></dc:creator>
		<pubDate>Wed, 12 Jan 2011 13:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-110659</guid>
		<description><![CDATA[Good Morning, Reading this website is a real pleasure, Many thanks !]]></description>
		<content:encoded><![CDATA[<p>Good Morning, Reading this website is a real pleasure, Many thanks !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-99021</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 11 Nov 2010 08:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-99021</guid>
		<description><![CDATA[How did you confirm the reader did not return data?]]></description>
		<content:encoded><![CDATA[<p>How did you confirm the reader did not return data?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: johnny</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-98885</link>
		<dc:creator><![CDATA[johnny]]></dc:creator>
		<pubDate>Wed, 10 Nov 2010 15:58:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-98885</guid>
		<description><![CDATA[how to do it in vb.net? i try use the reader but it faile to return any result]]></description>
		<content:encoded><![CDATA[<p>how to do it in vb.net? i try use the reader but it faile to return any result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-98884</link>
		<dc:creator><![CDATA[Johnny]]></dc:creator>
		<pubDate>Wed, 10 Nov 2010 15:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-98884</guid>
		<description><![CDATA[Hi! I had try it in Query, it work and give me result. 
I try to implement into vb.net with:

Dim sqlStatement1 As SqlCommand
sqlStatement1 = New SqlCommand(&quot;SELECT name, physical_name AS current_file_location FROM sys.master_files Where name = &#039;Ticket&#039;&quot;, mMain.Conn)


Dim sdr1 As SqlDataReader = sqlStatement1.ExecuteReader()

the reader return no result. why?]]></description>
		<content:encoded><![CDATA[<p>Hi! I had try it in Query, it work and give me result.<br />
I try to implement into vb.net with:</p>
<p>Dim sqlStatement1 As SqlCommand<br />
sqlStatement1 = New SqlCommand(&#8220;SELECT name, physical_name AS current_file_location FROM sys.master_files Where name = &#8216;Ticket&#8217;&#8221;, mMain.Conn)</p>
<p>Dim sdr1 As SqlDataReader = sqlStatement1.ExecuteReader()</p>
<p>the reader return no result. why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikram K Mahapatra</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-97172</link>
		<dc:creator><![CDATA[Vikram K Mahapatra]]></dc:creator>
		<pubDate>Mon, 01 Nov 2010 12:38:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-97172</guid>
		<description><![CDATA[We can also find the location of data file and log file by executing sp_helpfile.]]></description>
		<content:encoded><![CDATA[<p>We can also find the location of data file and log file by executing sp_helpfile.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Salman</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-89931</link>
		<dc:creator><![CDATA[Salman]]></dc:creator>
		<pubDate>Tue, 28 Sep 2010 15:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-89931</guid>
		<description><![CDATA[Give Solutin For Reduce size of Log File:]]></description>
		<content:encoded><![CDATA[<p>Give Solutin For Reduce size of Log File:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Find Most Active Database in SQL Server – DMV dm_io_virtual_file_stats Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-65412</link>
		<dc:creator><![CDATA[SQL SERVER – Find Most Active Database in SQL Server – DMV dm_io_virtual_file_stats Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Mon, 19 Apr 2010 01:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-65412</guid>
		<description><![CDATA[[...] 19, 2010 by pinaldave    Few days ago, I wrote about SQL SERVER – Find Current Location of Data and Log File of All the Database. There was very interesting conversation in comments by blog readers. Blog reader and SQL Expert [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 19, 2010 by pinaldave    Few days ago, I wrote about SQL SERVER – Find Current Location of Data and Log File of All the Database. There was very interesting conversation in comments by blog readers. Blog reader and SQL Expert [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreedhar</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-61296</link>
		<dc:creator><![CDATA[Sreedhar]]></dc:creator>
		<pubDate>Wed, 17 Feb 2010 01:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-61296</guid>
		<description><![CDATA[I noticed we have to do both match of the two queries, pinal dave and jerry hung.

In most of the production, the database name can be different and file names can also not be prefixed with database name.
(because of real backup and restore scenarios). 

Also, I add is the size in KB, MB, GB ... for better readability.

Hope it is useful for others.

SELECT 
	DB_NAME(mf.database_id) AS databaseName, 
	name as File_LogicalName,
	case 
		when type_desc = &#039;LOG&#039; then &#039;Log File&#039; 
		when type_desc = &#039;ROWS&#039; then &#039;Data File&#039; 
		Else type_desc 
	end as File_type_desc	
,mf.physical_name
,num_of_reads
,num_of_bytes_read
,io_stall_read_ms
,num_of_writes
,num_of_bytes_written
,io_stall_write_ms
,io_stall
,size_on_disk_bytes 
,size_on_disk_bytes/ 1024   as size_on_disk_KB
,size_on_disk_bytes/ 1024 / 1024 as size_on_disk_MB
,size_on_disk_bytes/ 1024 / 1024 / 1024 as size_on_disk_GB
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS divfs
JOIN sys.master_files AS mf ON mf.database_id = divfs.database_id
AND mf.file_id = divfs.file_id
ORDER BY  num_of_Reads DESC]]></description>
		<content:encoded><![CDATA[<p>I noticed we have to do both match of the two queries, pinal dave and jerry hung.</p>
<p>In most of the production, the database name can be different and file names can also not be prefixed with database name.<br />
(because of real backup and restore scenarios). </p>
<p>Also, I add is the size in KB, MB, GB &#8230; for better readability.</p>
<p>Hope it is useful for others.</p>
<p>SELECT<br />
	DB_NAME(mf.database_id) AS databaseName,<br />
	name as File_LogicalName,<br />
	case<br />
		when type_desc = &#8216;LOG&#8217; then &#8216;Log File&#8217;<br />
		when type_desc = &#8216;ROWS&#8217; then &#8216;Data File&#8217;<br />
		Else type_desc<br />
	end as File_type_desc<br />
,mf.physical_name<br />
,num_of_reads<br />
,num_of_bytes_read<br />
,io_stall_read_ms<br />
,num_of_writes<br />
,num_of_bytes_written<br />
,io_stall_write_ms<br />
,io_stall<br />
,size_on_disk_bytes<br />
,size_on_disk_bytes/ 1024   as size_on_disk_KB<br />
,size_on_disk_bytes/ 1024 / 1024 as size_on_disk_MB<br />
,size_on_disk_bytes/ 1024 / 1024 / 1024 as size_on_disk_GB<br />
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS divfs<br />
JOIN sys.master_files AS mf ON mf.database_id = divfs.database_id<br />
AND mf.file_id = divfs.file_id<br />
ORDER BY  num_of_Reads DESC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abson</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-53324</link>
		<dc:creator><![CDATA[Abson]]></dc:creator>
		<pubDate>Mon, 29 Jun 2009 13:54:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-53324</guid>
		<description><![CDATA[Hi

I am trying to Find Current Location of Data and Log File of All the Database on SQL 2000 but getting errors. It seems the compiler does not like name after SELECT statement.

Which word can I replace name with.]]></description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I am trying to Find Current Location of Data and Log File of All the Database on SQL 2000 but getting errors. It seems the compiler does not like name after SELECT statement.</p>
<p>Which word can I replace name with.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Hung</title>
		<link>http://blog.sqlauthority.com/2009/02/17/sql-server-find-current-location-of-data-and-log-file-of-all-the-database/#comment-47293</link>
		<dc:creator><![CDATA[Jerry Hung]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 20:45:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2593#comment-47293</guid>
		<description><![CDATA[Nice


below script shows the files used frequency (by joining with DMV dm_io_virtual_file_stats)

SELECT  DB_NAME(mf.database_id) AS databaseName
       ,mf.physical_name
       ,num_of_reads
       ,num_of_bytes_read
       ,io_stall_read_ms
       ,num_of_writes
       ,num_of_bytes_written
       ,io_stall_write_ms
       ,io_stall
       ,size_on_disk_bytes
FROM    sys.dm_io_virtual_file_stats(NULL, NULL) AS divfs
        JOIN sys.master_files AS mf ON mf.database_id = divfs.database_id
                                       AND mf.file_id = divfs.file_id
ORDER BY 3 DESC]]></description>
		<content:encoded><![CDATA[<p>Nice</p>
<p>below script shows the files used frequency (by joining with DMV dm_io_virtual_file_stats)</p>
<p>SELECT  DB_NAME(mf.database_id) AS databaseName<br />
       ,mf.physical_name<br />
       ,num_of_reads<br />
       ,num_of_bytes_read<br />
       ,io_stall_read_ms<br />
       ,num_of_writes<br />
       ,num_of_bytes_written<br />
       ,io_stall_write_ms<br />
       ,io_stall<br />
       ,size_on_disk_bytes<br />
FROM    sys.dm_io_virtual_file_stats(NULL, NULL) AS divfs<br />
        JOIN sys.master_files AS mf ON mf.database_id = divfs.database_id<br />
                                       AND mf.file_id = divfs.file_id<br />
ORDER BY 3 DESC</p>
]]></content:encoded>
	</item>
</channel>
</rss>

