Enterprise Issues Business Rules  «Prev  Next»

Accessing Remote Data - Exercise

Accessing remote data with Linked Server

Objective: Practice adding a linked server and accessing a remote stored procedure.

Exercise Scoring

This exercise is worth a total of 25 points. You will receive up to 25 points for accurately creating the Transact-SQL statement that does the following:
  1. Adds a linked server
  2. Executes a remote stored procedure on the linked server

Instructions

Assume that you are connected to a server named Washington. First, construct a Transact-SQL statement to add Boston as a linked server to Washington. Second, write a line of code that executes a remote stored procedure, called usp_GetSalary, located on the Boston server in the Employees database, owned by dbo. The usp_GetSalary stored procedure accepts one argument, which is the ID of the employee. In your SQL statement, pass the value of 205 for this parameter.

Submitting the exercise

Type or paste your Transact-SQL statement into the text box below, then click the Submit button to submit it and view a results page.