Home > Database > Mysql Tutorial > SQL Server数据库实例名与服务器名不一致的解决办法

SQL Server数据库实例名与服务器名不一致的解决办法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:59:02
Original
2036 people have browsed it

SQL Server数据库实例名与服务器名不一致的解决办法 1.--EXEC sp_addlinkedserver 2.-- @server = PSHGQ 3.--GO 4.--select * from sys.servers 5.--EXEC sp_dropserver PSHGQ 6.--EXEC sp_addserver SUGON, local 7.--select @@servername 8.--select server

SQL Server数据库实例名与服务器名不一致的解决办法

1.--EXEC sp_addlinkedserver   
2.--   @server = 'PSHGQ'   3.--GO   4.--select * from sys.servers   5.--EXEC sp_dropserver 'PSHGQ'   6.--EXEC sp_addserver 'SUGON', local   7.--select @@servername   8.--select serverproperty('servername')     9. 
10. 
11. 
12.use [数据库]      
13.go      
14.select @@servername     15.select serverproperty('servername')     16.go  
17.------     18.IF serverproperty('servername')@@servername       19.BEGIN     20.DECLARE @server SYSNAME     21.SET @server=@@servername         22.EXEC sp_dropserver @server=@server       23.SET @server=cast(serverproperty('servername') AS SYSNAME)      24.EXEC sp_addserver @server=@server,@local='LOCAL'        25.END     26.ELSE     27.PRINT '实例名与主机名一致,无需修改!'   
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
sql file
From 1970-01-01 08:00:00
0
0
0
php - Overhead of prepare vs sql?
From 1970-01-01 08:00:00
0
0
0
Print sql statement
From 1970-01-01 08:00:00
0
0
0
Pass array to SQL insert query using PHP
From 1970-01-01 08:00:00
0
0
0
sql optimization or
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template