Create Linked Server SQL Server 2008
From:http://www.jensbits.com/2010/11/10/create-linked-server-sql-server-2008/
http://www.c-sharpcorner.com/uploadfile/suthish_nair/linked-servers-in-sql-server-2008/
Creating a linked server in SQL Server 2008 is a great way to run CRUD statements against a completely different remote server. This method relies on Windows Authentication.
This is only one way to do it. There are others. And, if you are going to run SQL statements against a linked server from a web app, you need to have the permissions set up properly. From the article “How do I… Query foreign data using SQL Server’s linked servers?” by Susan Harkins:
The biggest catch to all this simplicity is, as always, security. If you’re working with Windows Authentication, the system accommodates well. If the user has the appropriate permissions for the servers and data sources, linked queries will work.
If you have users outside the Windows Authentication environment, you can use a linked login. Create a standard login and assign the appropriate permissions on the remote server.
Setting It Up
- Go to “Server Objects” of the database server where the linked server will be added and right click on “Linked Servers”. Select “Add New Linked Server”.
- In the “General” tab, add a name for the new linked server in the “Linked Server” field.
- Select “Other data source”and for “Provider” select “Microsoft OLE DB for SQL Server”
- For “Product Name” type in “SQLOLEDB”
- In the “Data Source” field, enter the IP address of the server to be linked
- “Catalog” is the name of the database on the linked server and is optional
- Go to the “Security” tab and select “Be made using this security context”. Type in the remote login and credentials


Running Queries
To query against this server user the syntax:
SELECT * FROM [MY_LINKED_SERVER].[database_name].[dbo].[table_name] |
Or, for a join, use linked table with an alias (example):
SELECT * FROM Table |
RIGHT OUTER JOIN |
[MY_LINKED_SERVER].[database_name].[dbo].[table_name] LinkedTable |
ON Table.column = LinkedTable.column |
This is a start. Where you go from here is up to you.
Create Linked Server SQL Server 2008的更多相关文章
- .NET编程和SQL Server ——Sql Server 与CLR集成 (学习笔记整理-1)
原文:.NET编程和SQL Server ——Sql Server 与CLR集成 (学习笔记整理-1) 一.SQL Server 为什么要与CLR集成 1. SQL Server 提供的存储过程.函数 ...
- [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]列名 'user1' 无效
唉,还是自己对php执行sql语句运用不熟练.... 我的错误代码是这样的,(解决办法在最后) $re=sqlsrv_query($conn, "select * from visitor ...
- [ERROR]pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]SQL Server 阻止了对组件“xp_cmdshell”的 过程“sys.xp_cmdshell”的访问
环境: Windows 2012 R2 SQL Server 2014 通过MSSQL查询数据库服务器时间,报错如下: pyodbc.ProgrammingError: (', '[42000] [M ...
- [转]create a basic sql server 2005 trigger to send email alerts
本文转自:http://blog.netnerds.net/2008/02/create-a-basic-sql-server-2005-trigger-to-send-e-mail-alerts/ ...
- Create the first sql server 2016 mobile report;创建 第一个 sqlserver 2016 Mobile report
在微软收购了datazen之后,sqlserver2016 集成了mobilereport,mobile report 基于html5,兼容各类主流浏览器,之前ssrs2008 R2中很多chart类 ...
- SQL Server ->> SQL Server 2016重要功能改进之 -- INSERT SELECT时并发插入数据
SQL Server 2016对INSERT INTO XXXX SELECT语句进行了优化,在某些情况下可以触发数据的并行插入,但是要求兼容模式是130(SQL Server 2016)以及在插入的 ...
- SQL Server ->> SQL Server 2016新特性之 -- Dynamic Data Masking
Dynamic Data Masking是为了防止敏感数据暴露给未经授权的用户,以一种最小开销和维护成本的形式.Dynamic Data Masking用于表的字段,相当于盖住字段数据的一部分.比如一 ...
- C#构造方法(函数) C#方法重载 C#字段和属性 MUI实现上拉加载和下拉刷新 SVN常用功能介绍(二) SVN常用功能介绍(一) ASP.NET常用内置对象之——Server sql server——子查询 C#接口 字符串的本质 AJAX原生JavaScript写法
C#构造方法(函数) 一.概括 1.通常创建一个对象的方法如图: 通过 Student tom = new Student(); 创建tom对象,这种创建实例的形式被称为构造方法. 简述:用来初 ...
- [MS SQL Server]SQL Server如何开启远程访问
在日常工作中,经常需要连接到远程的MS SQL Server数据库中.当然也经常会出现下面的连接错误. 解决方法: 1. 设置数据库允许远程连接,数据库实例名-->右键--->属性---C ...
随机推荐
- bug检测报告---礼物挑选小工具--飞天小女警
飞天小女警----礼物挑选小工具 测试产品链接:http://123.207.159.79:8088/giving_gifts/ 发布在作者的博客里面:http://www.cnblogs.com/s ...
- 获取dll中根目录
AppDomain.CurrentDomain.BaseDirectory获取当前应用程序域的基目录 好像是万能的:form:可执行文件路径控制台:输出路径web:根目录
- 企业信息系统——CRM
客户关系管理系统(Customer Relationship Management)将客户看作是企业的一项重要资产,客户关怀是CRM的中心,其目的是与客户建立长期和有效的业务关系,在与客户的每个“接触 ...
- 【20160924】GOCVHelper 图像处理部分(1)
增强后的图像需要通过图像处理获得定量的值.在实际程序设计过程中,轮廓很多时候都是重要的分析变量.参考Halcon的相关函数,我增强了Opencv在这块的相关功能. //寻找最大的轮廓 ...
- 【SSO单点系列】(3):CAS4.0 登录页验证码的添加
2016.08.23 更新 注意:这个教程只适合4.0版本的,4.1以及以上的版本的已经不试用了, 后面几篇有人提到过 源码网盘链接更新了下 : 链接: http://pan.baidu.com/s/ ...
- 改变Web Browser控件IE版本
默认的webbrowser控件使用的渲染模式版本似乎是IE7,想要更改更高版本,如下: 在注册表位置 HKEY_CURRENT_USER\Software\Microsoft\Internet Exp ...
- linux权限,所有者、所在组、其他组(其他人员),chmod,chown
用户组 在linux中的每个用户必须属于一个组,不能独立于组外.在linux中每个文件有所有者.所在组.其它组的概念 - 所有者 - 所在组 - 其它组 - 改变用户所在的组 所有者 一般为文件的创建 ...
- SQL Server 2012 管理新特性:AlwaysOn【转】
http://jimshu.blog.51cto.com/3171847/871169 见超链接
- Nginx 简介
一.介绍 Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器. Nginx是一款轻量级的Web服务器/反向代理服务器以及电子邮件代理服务器,并在一个BSD ...
- 《BI那点儿事》Cube的存储
关系 OLAP (ROLAP)ROLAP的基本数据和聚合数据均存放在关系数据库中:ROLAP 存储模式使得分区的聚合存储在关系数据库的表(在分区数据源中指定)中.但是,可为分区数据使用 ROLAP 存 ...