In SQL Serve 2012, we can get the default data file and log file locations using a simple T-SQL query as below:
SELECT SERVERPROPERTY('INSTANCEDEFAULTDATAPATH') AS [Default_Data_path] ,SERVERPROPERTY('INSTANCEDEFAULTLOGPATH') AS [Default_log_path] GO
Sample Output:
These parameters INSTANCEDEFAULTDATAPATH & INSTANCEDEFAULTLOGPATH are new in SQL Server 2012 and are not documented yet. Usually undocumented features like these aren’t tested rigorously which is why Microsoft says they are not intended to be used by customers.
Leave a Reply