机器名修改
USE MASTER
GO
SELECT @@servername
SELECT 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