I would like to know if there is any query that can be used to determine which drive, i.e. C:\
drive, SQL Server is located on.
Thanks in advance.
I would like to know if there is any query that can be used to determine which drive, i.e. C:\
drive, SQL Server is located on.
Thanks in advance.
Try this:
SELECT name, physical_name AS current_file_location FROM sys.master_files;
You can also use an undocumented system stored procedure to get the installation folder, e.g.:
DECLARE @Path VARCHAR(100);
SELECT @Path = NULL;
EXEC MASTER..xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ClientSetup', 'SQLPath', @Path OUTPUT;
SELECT @Path;