更改SQL Server服务器实例名

use master

go

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
posted on 2011-06-28 17:54  aquilahkj  阅读(838)  评论(0编辑  收藏  举报