September 11, 2008 at 9:35 am
One can set the value for the max number of SQL ERRORLOG files to be kept on disk by rightclicking on the SQL Server Logs node (SSMS), selecting Configure and setting the number in the resulting dialog.
Where in the system catalog is this value stored? I need to automate a process based on this number, so I need to know where to get it from on the fly.
Thanks for any replies!
__________________________________________________________________________________
SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
Persisting SQL Server Index-Usage Statistics with MERGE[/url]
Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]
September 11, 2008 at 9:49 am
It's not stored anywhere in SQL. It's in the registry.
I can't remember offhand where, easiest way to find where is to run profiler and filter the trace based on your machine, then go into that dialog and change it. You'll see the SQL code to read the value from the registry
Beware, undocumented feature and I believe sysadmin is needed to run it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 11, 2008 at 9:57 am
GilaMonster (9/11/2008)
It's not stored anywhere in SQL. It's in the registry.I can't remember offhand where, easiest way to find where is to run profiler and filter the trace based on your machine, then go into that dialog and change it. You'll see the SQL code to read the value from the registry
Beware, undocumented feature and I believe sysadmin is needed to run it.
Thank you, I think you gave me what I need.
Cheers!
__________________________________________________________________________________
SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
Persisting SQL Server Index-Usage Statistics with MERGE[/url]
Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]
September 11, 2008 at 10:24 am
You can right click SQL Server Logs and go to configure.
But here is the command:
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'NumErrorLogs', REG_DWORD, X
Where X is the amount of error logs kept before they are recycled.
September 11, 2008 at 10:59 am
Adam Bean (9/11/2008)
You can right click SQL Server Logs and go to configure.But here is the command:
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'NumErrorLogs', REG_DWORD, X
Where X is the amount of error logs kept before they are recycled.
thanks! So to read the entry I'd have to use xp_instance_regread...
__________________________________________________________________________________
SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
Persisting SQL Server Index-Usage Statistics with MERGE[/url]
Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]
September 11, 2008 at 11:58 am
Yes, or travel directly to the registry ... easiest way is to just use SSMS though.
September 11, 2008 at 12:01 pm
Adam Bean (9/11/2008)
Yes, or travel directly to the registry ... easiest way is to just use SSMS though.
I'm looking into automating this, so using the xp is the way to go.
__________________________________________________________________________________
SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
Persisting SQL Server Index-Usage Statistics with MERGE[/url]
Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply