375
Chapter 15: Executing Distributed Queries
15
FIGURE 15-2
Creating a Named Range.
The code samples used in this section are from a spreadsheet included on the website for
this book. The spreadsheet contains a single page taken from the Person. Contact table
from the AdventureWorks SQL Server database. The range defi ned in the spreadsheet
includes a fi rst name column, a last name column, and an e-mail address. The spreadsheet
is called AdvetureWorksContacts, and the range is called People.
The following example sets up the Excel spreadsheet as a linked server:
exec sp_addlinkedserver
@server='AdventureWorksContacts',
@srvproduct = 'Jet 4.0',
@provider='Microsoft.Jet.OLEBDB.4.0',
@datasrc='D:\Projects\Wiley\SQL Server 2011 Bible\
AdventureWorksContacts.xls',
@provstr='Excel 5.0'
c15.indd 375c15.indd 375 7/30/2012 4:50:39 PM7/30/2012 4:50:39 PM
http://www.it-ebooks.info