Friday, March 6, 2015

How can get SQL Server Installation Path

declare @rc int, @dir nvarchar(4000)Exec @rc = master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\Setup',
N'SQLPath',
@dir output, 'no_output'
Select @dir AS InstallationDirectory

No comments:

Post a Comment