重命名服务器,对于SQL SERVER 的配置

if   serverproperty('servername')   <>   @@servername  
         begin  
            declare   @server   sysname  
            set   @server   =   @@servername   
            exec   sp_dropserver   @server,'droplogins' 
            set   @server   =   cast(serverproperty('servername')   as   sysname)  
            exec   sp_addserver   @server   =   @server   ,   @local   =   'LOCAL'  
        end

重启数据库服务器,使用一下代码检验

use master

      go

      select @@servername
      select serverproperty('servername')

 

上一篇:Linux在vi编辑模式下如何查找字符串


下一篇:LINUX_修改_servername