PrepAway - Latest Free Exam Questions & Answers

What should you do?

Your application must access data that is located on two SQL Server 2005 computers. One of these servers is named SQL1 and the other is SQL2. You have permissions to create a stored procedure on SQL1 to support your application. However, on SQL2 you only have permissions to select data.
You write the stored procedure on SQL1. The stored procedure accesses SQL2 by using the OPENQUERY Transact-SQL statement. However, the query fails when executed. You need to troubleshoot the cause of the error. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Join the two servers by using the four-part syntax of server.database.schema.table.

B.
Reference SQL2 by using an alias.

C.
Add SQL2 as a remote server to SQL1.

D.
Add SQL2 as a linked server to SQL1.

Explanation:
You need to define a linked server for each external data source you want to access and the configure the security context under which your distributed queries will run. After you create a linked server, you can use the Transact-SQL OPENQUERY function to execute your distributed queries.


Leave a Reply