November 18, 2014 at 4:40 am
Hi all,
Is there an Admin script that yields the following directories?
Data
Data Root
Log
TempDB
Shared Feature
Backup
Thanks,
Jake
November 18, 2014 at 4:53 am
well, i know three of them are stored in the registry, o a per-isntance basis.
EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'BackupDirectory';
EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData';
EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog';
so that leaves the items below:
what is the data root?
my tempdb is split across multiple files, so do you want where the current first tempdb file resides?
Jake Shelton (11/18/2014)
Hi all,Is there an Admin script that yields the following directories?
DataData Root
LogTempDB
Shared Feature
BackupThanks,
Jake
Lowell
November 18, 2014 at 4:58 am
when i query my dev server for tempdb, for example, i get three locations:
select * from tempdb.sys.database_files
D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\tempdb.mdf
L:\Logs\templog.ldf
E:\MSSQL\Data\tempdb2.ndf
Lowell
November 18, 2014 at 5:24 am
Another wrinkle is that the databases could be installed in different directories. I don't have mine that way, but it could be done. If you query sys.master_files, it will give you the data and log directories for all databases.
November 18, 2014 at 6:28 am
Good work fellas, thanks!! 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply