1、 查看電腦名use master go select @@servername select serverproperty('servername') 2、同步更新SQLserverif serverproperty('servername') <> @@servername begin de ...
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')