1、 查看计算机名
use master
go
select @@servername
select serverproperty('servername')
2、同步更新SQLserver
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
3、 重启数据库服务
4、 查看更新后的计算机名
use master
go
select @@servername
select serverproperty('servername')