Accessing the Data of a global temp table existing in the other server.

Prerequisites:

1) The session of the Global temp table should be active.

2) The server that needs to be accessed should be existing in Linked Server List. We can find the same by executing sp_linkedservers or SELECT * FROM SYSSERVERS, from the server of the currently working session.

QUERY:

SELECT * FROM OPENQUERY(LINKED_SERVERNAME, 'SELECT * FROM ##temp123')

No comments:

Post a Comment