Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get Data, Log, Backup, and Binn Directory (SQL Server 2005)


Get Data, Log, Backup, and Binn Directory (SQL Server 2005)

Author
Message
Cowboy DBA
Cowboy DBA
SSC Journeyman
SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)

Group: General Forum Members
Points: 99 Visits: 2255
Comments posted to this topic are about the item Get Data, Log, Backup, and Binn Directory (SQL Server 2005)
Rudy Panigas
Rudy Panigas
SSC-Addicted
SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)

Group: General Forum Members
Points: 440 Visits: 1302
Hello,

Nice script. I've tested it a SQL server with 6 instances and your code does not product the instance name. It seem to work on default instance only.

I like it.

Rudy



Cowboy DBA
Cowboy DBA
SSC Journeyman
SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)

Group: General Forum Members
Points: 99 Visits: 2255
This is odd as I've just ran it against a named instance and it works as expected. SadUnsure
Rudy Panigas
Rudy Panigas
SSC-Addicted
SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)SSC-Addicted (440 reputation)

Group: General Forum Members
Points: 440 Visits: 1302
Are you executing this on a SQL server with more than one instance? I've tried on SQL server 64bit as I don't have any 32 bit servers.



Cowboy DBA
Cowboy DBA
SSC Journeyman
SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)SSC Journeyman (99 reputation)

Group: General Forum Members
Points: 99 Visits: 2255
Yes. On 32Bit though
Paul Munkenbeck
Paul Munkenbeck
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 150
Hi, this script is a great idea and does exactly what I needed to document some server settings before I apply a change to default data and log values.

I have found a small bug in the script. If the DefaultData value is set but the DefaultLog is not set then the DefaultLog is displayed as the DefaultData value rather than the SQLDataRoot value. This is because the @path variable is no longer null going into the xp_instance_regread for the DefaultLog value. The xp does not find the value for DefaultLog as it is not set, and therefore does not alter the value in @path, but @path is not null as it contains the value from DefaultData set previously.
To fix this I just added a SET @path = NULL before each call to xp_instance_regread

Thanks again.
dhay1999
dhay1999
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 363
Exactly what I was looking for. I needed a path for automated tracing that the sql agent account had permissions to, and not dump everything in the root of C:\ like my predecessor in SQL 2000. It works on my multiple instance machine SQL2008.

I added the following to get the default errorlog path

SET @path = NULL
exec @returncode = master.dbo.xp_instance_regread N'hkey_local_machine',N'software\microsoft\mssqlserver\CPE',N'ErrorDumpDir', @path output, 'no_output'


Thanks a bunch!


david hay
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search