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 ...
随机推荐
- Magento开发常用方法
这里是我做Magento开发常用到的方法,现在总结出来,后续会把更多有用的方法总结出来. 1.直接操作数据库 查找数据:$read = Mage::getSingleton("core/re ...
- volatile使用详解
Java 语言中的 volatile 变量可以被看作是一种 “程度较轻的 synchronized”:与 synchronized 块相比,volatile 变量所需的编码较少,并且运行时开销也较少, ...
- PHP 教程
PHP 教程 源地址 PHP 是一种创建动态交互性站点的强有力的服务器端脚本语言. PHP 是免费的,并且使用非常广泛.同时,对于像微软 ASP 这样的竞争者来说,PHP 无疑是另一种高效率的选项. ...
- ECMAScript 6教程 (二) 对象和函数
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出 原文连接,博客地址为 http://www.cnblogs.com/jasonnode/ .该系列课程是 ...
- How to run a (Tomcat)Java application server on a Azure virtual machine
http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-applicatio ...
- PoE以太网远程供电
每个以太网口向下挂设备提供的最大功率为 15.4W 通过3/5 类双绞线的信号线(1.3.2.6)同时传递数据和电流
- CSS 笔记二(Text/Fonts/Links/Lists)
CSS Text 1> Text Color used to set the color of the text 2> Text Alignment used to set the hor ...
- vm虚拟机启动失败 Global\vmx86
workstation12 PRO 启动虚拟机异常报错:无法打开内核设备“\\.\Global\vmx86”: 系统找不到指定的文件 解决方法,启动windows系统服务:
- calico docker 应用实例
在上一篇文章<quay.io/coreos/etcd 基于Docker镜像的集群搭建>中,介绍了ETCD集群的搭建.在此基础上,我们进一步实践calico docker的应用. PaaS ...
- java 中继承,组合,重载,重写的实现原理 (转)
我们知道,继承,组合,重载,重写是java语言的面向对象实现的基本特征. 那么在java内部,究竟是如何实现这些面对对象的基本特征的呢? 继承和组合是面向对象中代码复用的主要实现方式,他们可以达到类似 ...