x

Temp table usage

which server the heavy lifting of the optimization and processing of the SELECT statement will be done in the following scenario? In other words, if the SELECT statement were a complex, memory hungry query, which server will it kill? ServerA or ServerB?

ServerA has a linked server to ServerB

Connect to ServerA and execute the following SQL: INSERT INTO #temp1 SELECT F1, SUM(F2) FROM ServerB.Database1.Table1 Group by F1

more ▼

asked Oct 11, 2016 at 04:43 PM in Default

avatar image

sksql
22 1 2 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You cannot create a temp table remotely using the linked server. It pulls data locally and creates the temp table locally too. So in your scenario, Server A will get the load of the temp table. Your network will get slammed passing all the data from B to A and Server B will get the load of the Select statement.

more ▼

answered Oct 14, 2016 at 02:09 AM

avatar image

askcoffman
61 3

Thank you for putting this in Perspective ! Appreciate your help !

Oct 18, 2016 at 05:13 AM sksql
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x78

asked: Oct 11, 2016 at 04:43 PM

Seen: 65 times

Last Updated: Oct 18, 2016 at 05:13 AM

Copyright 2017 Redgate Software. Privacy Policy