Multiple choice technology databases

You want to access data that is located on two SQL Server 2005 computers. One Server is SQL 1 and the other server is SQL 2. You have permissions to write a stored Procedure on SQL 1 but on SQL 2 you have only permission to select data. You write a stored procedure on SQL 1. The stored procedure accesses SQL 2 by OPENQUERY T-SQL Statement. The query fails. What should you do the solve the problem?

  1. (a) Add SQL 2 as linked server to SQL 1

  2. (b) Add SQL 2 as remote Server to SQL 1

  3. (c) Reference SQL 2 by an alias

  4. (d) None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is an exact duplicate of question 143704. The OPENQUERY function requires a linked server to be configured first. The error occurs because SQL 1 doesn't have SQL 2 registered as a linked server. Adding SQL 2 as a linked server (option A) creates the necessary connection object that OPENQUERY can then reference. A remote server (option B) is an older SQL Server concept mainly for remote stored procedures, not for OPENQUERY queries. Aliases (option C) are for local naming, not for cross-server connections.