Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

370


Part III: Advanced T-SQL Data Types and Querying Techniques


This dialog has three pages; General, Security, and Server Options. These pages defi ne the
properties of the server you are linking to.

General Page
The General page is where the linked server and server type are specifi ed. In the Linked
Server textbox, enter the name of the external SQL Server and select the SQL Server button
for the Server Type. For named SQL Server instances, enter the instance name as server\
instance.

SQL Server 2012 can link to a SQL Server 7 and later. If you want to link to SQL Server 6.5,
you need to use an ODBC driver.

Security Page
The Security page is a page that should not be overlooked. The purpose of using linked
servers is to provide users with the ability to run queries that access data from other data
sources. You defi nitely want your data to be secure, so requiring users to authenticate is
required.

For linked servers, authentication is achieved via login mappings. If the users are local
users whose logins are not mapped, authentication is done by setting the default behavior.

The login mapping works by either passing the user along to the external source without
translating the login name (if the Impersonate option is checked), or by translating a user’s
login to a remote login and password (if the Impersonate option is not checked). It should
go without saying that the login specifi ed must be a valid login on the external server.

The list on this page is where you map local server logins to remote server logins. The local
login specifi es the login that can connect to the linked server using either Windows or SQL
authentication. If you want to pass the username and password from the local login to the
linked server, select the Impersonate checkbox. The Remote User and Password fi elds in the list
allow you to map users (and their associated passwords) not defi ned in the local login fi eld.

There are four connection options that specify the security context that are used when
connecting the original SQL Server to the linked server:

■ Not be made: Specifi es that the connection will not be made for logins not defi ned
in the list
■ Be made without using a security context: Specifi es that the connection will be
made without using a security context for logins not defi ned in the list
■ Be made using the login’s current security context: Specifi es that the connection
will be made using the current security context of the login for logins defi ned in
the list

■ (^) Be made using this security context: Specifi es that a connection will be made
using the login and password specifi ed in the Remote login and With password
boxes
c15.indd 370c15.indd 370 7/30/2012 4:50:38 PM7/30/2012 4:50:38 PM
http://www.it-ebooks.info

Free download pdf