Skip to main content

Posts

Showing posts from November, 2007

SQL .mdf, .ldf path from query

try this code DECLARE @retvalue int, @data_dir varchar(500) EXECUTE @retvalue = master.dbo.xp_instance_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\MSSQLServer\Setup', 'SQLDataRoot', @param = @data_dir OUTPUT PRINT 'SQL Server Data Path: '+ @data_dir i get it from here