SQL Server Performance

TSQL to get default location of database data and log files?

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Jan 8, 2008.

  1. Anonymous New Member

    By default the SQL Server database data &amp; log files are created on the default data directory which is Program Files or based on where SQL binary files are installed. In order to find what is the default location you can run following TSQL: declare @SmoDefaultFile nvarchar(512) exec master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLServer', N'DefaultData', @SmoDefaultFile OUTPUT declare @SmoDefaultLog nvarchar(512) exec master.dbo.xp_instance_regread...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2008/01/08/3122.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=3122" width="1" height="1">

Share This Page