Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Home Directory and Error Log Paths from t-sql

Author  Topic 

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-08-27 : 09:34:53
Is it possible to derive the : SQL Server Instance Home directory and Error Log file for a given instance from t-sql ?

In other words , if the ErrorLog path is : C:\SQLServer\ErrorLog\Log that is the result I'm looking for ?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2008-08-27 : 11:59:03
select ServerProperty('ErrorLogFileName')

declare @SmoRoot nvarchar(512)
exec master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\Setup', N'SQLPath', @SmoRoot OUTPUT

Go to Top of Page
   

- Advertisement -