zoukankan      html  css  js  c++  java
  • xp_instance_regwrite syntax

    The stored procedure "master.sys.xp_instance_regwrite" is not documented in SQL Server Books Online (BOL), but is usefull. In general the syntax is
    EXECUTE [master].[sys].[xp_instance_regwrite]
      @rootkey = N'<name of root key>'
     ,@key = N'<key name>'
     ,@value_name = N'<key name value>'
     ,@type = N'<key type>'
     ,@value = <key value>;


    For example the number of SQL Server Errorlog files can be updated by the statement
    EXECUTE [master].[sys].[xp_instance_regwrite]
      @rootkey = N'HKEY_LOCAL_MACHINE'
     ,@key = N'Software\Microsoft\MSSQLServer\MSSQLServer'
     ,@value_name = N'NumErrorLogs'
     ,@type = N'REG_DWORD'
     ,@value = 42;


    Use with caution!


    The parameter @type takes a value without N'' around (@type = <key type>), but I like the Unicode framing. This way I try to avoid difficulties when building the values outside the call.

  • 相关阅读:
    练习_Python3 爬取笔趣阁最新小说章节
    Python3 map()函数
    Java图片验证码生成
    神经网络
    leetcode
    hive开发规范
    北明数科 bug
    JAVA集合~
    令人头痛的JVM
    重定向和管道符
  • 原文地址:https://www.cnblogs.com/flysun0311/p/2660021.html
Copyright © 2011-2022 走看看