Home  >  Article  >  Database  >  Questions about setting up the registry in SQL

Questions about setting up the registry in SQL

一个新手
一个新手Original
2017-10-20 11:27:212269browse

## I wrote an article before Blog post"MS SQL Logging Management", which introduces how to set up the error log of SQL Server The maximum number of archives, if set in the UI interface of SSMS, can be set from "Management" -> "SQL Server Logs" Right-click option"Configure" Set the number of error logs as follows:


Questions about setting up the registry in SQL

If you use script settings, as shown below, this script can also modify the maximum number of error logs


##

USE [master];GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
    N'Software\Microsoft\MSSQLServer\MSSQLServer', N'NumErrorLogs', REG_DWORD,
    10;
GO

Take SQL Server 2008 as an example (default instance), the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer does not have this parameter NumErrorLogs, this parameter is actually located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer below

Take SQL Server 2014 as an example (default instance), the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer does not have this parameter NumErrorLogs, this parameter is actually located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQLServer below

##Of course if it is Named instances and registry paths are still different, but the above stored procedures can modify the registry using the above parameters (same parameters)NumErrorLogs Parameters, was originally # The value combination of ##N'HKEY_LOCAL_MACHINE' and N'Software\Microsoft\MSSQLServer\MSSQLServer' is the specific path of the parameter in the registry, but actual verification found that this is not the case. In addition, due to ##master.sys.xp_instanc e_regwrite is a stored procedure without documentation, so I don’t know how it is processed internally. That is to say, I don’t know whether it is converted internally or for other reasons. This is a very confusing and puzzling question.

# #

Questions about setting up the registry in SQL

Questions about setting up the registry in SQL

The above is the detailed content of Questions about setting up the registry in SQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn