linked server question

linked server question

Post by JC » Sat, 17 Aug 2002 18:01:10



Im selecting from a table on a linked server but the
query is very slow as the clause relies on data on my
local server. In the local table there are about 500
entries. in the table in the linled server there are
several million.
Im using something like this :

insert into table
select * from server.db.dbo.table where userid in (select
userid from localtable)

is there any more sfficient way of managing this ?

JC

 
 
 

linked server question

Post by Marek Kepinsk » Sat, 17 Aug 2002 21:05:37


Hi JC,
I see two solutions to your problem:
1. Transfer local table to the linked server and then call a procedure on
this server that does what you need. In this case you need to transfer 500
records over the network and call 1 stored procedure - shouldn't be a
problem. You may need to define a linked server in the oposite direction for
the stored procedure.
2. Create a cursor for the local table in your local database, read userid
and for each of them run the insert statement with userid specified
explicitly.
Marek


Quote:> Im selecting from a table on a linked server but the
> query is very slow as the clause relies on data on my
> local server. In the local table there are about 500
> entries. in the table in the linled server there are
> several million.
> Im using something like this :

> insert into table
> select * from server.db.dbo.table where userid in (select
> userid from localtable)

> is there any more sfficient way of managing this ?

> JC


 
 
 

1. Linked Servers question

Hi
I noticed, when linking servers, only pure SQL7 Servers
(sp_addlinkedserver 'ServerM',
N'SQL Server')

I'm linking SQL server M to server N both are NT security only, using the
SQL service account in the M server as a user with security permissions on a
database.

When I logon to server N directly I can do selects on a view of a table in
the connected database.
But when I log on to server N from another machine via Enterprise manager, I
can not get my select statements to work. It comes up with user / can't log
in or something like that. I've tried all sorts of NT impersonations, none
of them made a difference.
The links views, probably work with stored procedures because they are run
in their own space.

I don't have this problem with ODBC Linked Servers.

Is this a feature of linking SQL7 servers?

Thanks

2. Measuring query performance

3. Linked Server Question 7.0 / 6.5 (ASAP would be great)

4. resource dll different version than driver manager

5. linked server question

6. Slowing Down !!!!

7. Linked Server Question

8. Calling an Oracle Stored Procedure

9. Linked server question

10. Linked Server Question

11. A linked Server Question?