成都网站建设设计

将想法与焦点和您一起共享

SQLServer服务器名称与默认实例名不一致

use master      
       go      
       select @@servername,serverproperty('servername')    
------    
  IF serverproperty('servername')<>@@servername      
  BEGIN    
  DECLARE  @server SYSNAME    
  SET   @server=@@servername        
  EXEC  sp_dropserver @server=@server      
  SET   @server=cast(serverproperty('servername') AS SYSNAME)     
  EXEC  sp_addserver @server=@server,@local='LOCAL'       
  END    
  ELSE    
    PRINT '实例名与主机名一致,无需修改!'    ![](/upload/otherpic66/171155.jpg)

分享名称:SQLServer服务器名称与默认实例名不一致
文章分享:http://chengdu.cdxwcx.cn/article/jpcsdg.html