Home > Database > Mysql Tutorial > SQLSERVER从一个Server访问另外一个Server中的数据的方法

SQLSERVER从一个Server访问另外一个Server中的数据的方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:40:41
Original
1202 people have browsed it

调用自带的sp_addlinkedserver存储过程,代码如下: EXEC sp_addlinkedserver 'ADB(要连接的server的别名)','','SQLOLEDB','要连接的server' --有自定义实例名还要加上"/实例名" EXEC sp_addlinkedsrvlogin 'ADB' 执行后就可使用别名去使用另外一个数据库了

调用自带的sp_addlinkedserver存储过程,代码如下:

EXEC sp_addlinkedserver 'ADB(要连接的server的别名)','','SQLOLEDB','要连接的server' --有自定义实例名还要加上"/实例名"
EXEC sp_addlinkedsrvlogin 'ADB'

执行后就可使用别名去使用另外一个数据库了

select * from ADB.datawarehouse.dbo.Table1

Related labels:
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
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
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