Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Query view via linked server

Author  Topic 

Blin
Starting Member

36 Posts

Posted - 2006-02-01 : 14:46:31
We cannot access the data in the view via:

select * from openquery([90.130.57.30], 'select * from agent_view where convert(varchar,date_time,112) = convert(varchar,getdate()-1,112)')

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' reported an error.
[OLE/DB provider returned message: Deferred prepare could not be completed.]
[OLE/DB provider returned message: Timeout expired]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ::GetColumnsRowset returned 0x80004005: ].

We can see the server and select * from tables but cannot pull from the view through a linked server.

Can anyone help?

Thanks,
Ben

bakerjon
Posting Yak Master

145 Posts

Posted - 2006-02-01 : 15:35:22
You may need to set the query timeout parameter higher. It will act like an ADO connection and can timeout if the query runs too long (i.e. 30 secs).

Jon
-Like a kidney stone, this too shall pass.

http://www.sqljunkies.com/weblog/outerjoin
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-02-01 : 21:22:18
quote:
select * from agent_view where convert(varchar,date_time,112) = convert(varchar,getdate()-1,112)

or change your query to be more efficient, like
select * 
from agent_view
where date_time >= dateadd(day, 0, datediff(day, 0, getdate() - 1)
and date_time < dateadd(day, 0, datediff(day, 0, getdate())


----------------------------------
'KH'


Go to Top of Page
   

- Advertisement -