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 '实例名与主机名一致,无需修改!' ![](https://cache.yisu.com/upload/information/20200311/41/171155.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。