Re: Distributed Query Problems
From: CPK (VirtualChris_at_Yahoo.com)
Date: 10/29/04
- Next message: Joe: "SQL-DMO equivalent of sp_addmessage"
- Previous message: Joe K.: "Maximum of Amount Elapsed Time Job Step"
- In reply to: Jeff B: "Distributed Query Problems"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 29 Oct 2004 19:10:58 -0400
Try making your own variation of this example,
DECLARE @TSQL varchar(8000), @VAR char(2)
SELECT @VAR = 'CA'
SELECT @TSQL = 'SELECT * FROM OPENQUERY(remoteserver,''SELECT * FROM
pubs.dbo.authors WHERE state = ''''' + @VAR + ''''''')'
EXEC (@TSQL)
"Jeff B" <Jeff B@discussions.microsoft.com> wrote in message
news:159F61BA-F766-4F73-89D6-F082DE24F259@microsoft.com...
> OK... On the local server I have a table with 1,000,000 records. I am
> selecting 200 records from this table, and joining on an id column to a
table
> with 2,000,000 records on the remote server. The query should only retun
> about 200 records. When I look at the query plan, I see that the remote
query
> is actually fetching all 2,000,000 records from the remote server. This
> doesn't seem right. Are there any tricks to get the remote part of the
query
> to apply a where clause?
- Next message: Joe: "SQL-DMO equivalent of sp_addmessage"
- Previous message: Joe K.: "Maximum of Amount Elapsed Time Job Step"
- In reply to: Jeff B: "Distributed Query Problems"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|