Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Linked Server error - ODBC timeout

 
   Database Forums (Home) -> ODBC RSS
Next:  Running a Job / Parse Issues  
Author Message
David Taylor

External


Since: Apr 18, 2008
Posts: 1



(Msg. 1) Posted: Fri Apr 18, 2008 1:29 am
Post subject: Linked Server error - ODBC timeout
Archived from groups: microsoft>public>sqlserver>odbc (more info?)

My MS Access app links to an SQL Server 2000 db which includes a linked
server.

A pass through query like "select * from linkedtable" works fine. But
"select * from linkedtable where linkedtablekey=1" fails - ODBC timeout
error.

The same thing happens when I try the queries in Query Analyzer.

This error only occurs on the production computer - the queries work fine in
the test environment.

Thanks, in advance, for suggestions.

DT

 >> Stay informed about: Linked Server error - ODBC timeout 
Back to top
Login to vote
Sylvain Lafontaine1

External


Since: Dec 13, 2003
Posts: 247



(Msg. 2) Posted: Sun Apr 20, 2008 6:26 pm
Post subject: Re: Linked Server error - ODBC timeout [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Maybe a bad query plan or the execution take to much time because there are
no index on the linkedtablekey column. (If you have upsized this table from
Access, make sure that this column has been declared as the primary key for
the table. The Upsizing Wizard often forget to do this.)

After checking for the possibility of a missing primary key (or index), the
second thing to do would be to update the statistics using the
sp_updatestats stored procedure (or use the command UPDATE STATISTICS is you
want to work on a more detailed level) and clean
the caches after that:

DBCC FLUSHPROCINDB
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

After that, you can think about reindexing and - very important -, you can
take some precautions about the use of atypical parameters and
recompilations in order to eliminate the reuse of bad query plans. See:
http://sqlknowledge.com/index.php?op...d=65&Itemid=41

Reindexing:
http://blog.sqlauthority.com/2007/01...ics-on-tables/

Good article on the use of the With Recompile option and of intermediary
variables in
order to deactivate the parameters sniffing from SQL-Server (the use of
intermediary variables is probably better than to use the With Recompile
option because recompiling big procedures take time):
http://blogs.msdn.com/khen1234/archi...02/424228.aspx . (It's
useless to use both at the same time).

If you are with SQL-Server 2005, you can also play with the OPTIMIZE FOR
option instead of deactivating the parameters sniffing or using the With
Recompile option; see:
http://www.sql-server-performance.co...guides_p1.aspx
and
http://www.sql-server-performance.co..._hints_p1.aspx

Finally, a good reference on recompilation:
http://www.microsoft.com/technet/pro...05/recomp.mspx

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


"David Taylor" wrote in message

> My MS Access app links to an SQL Server 2000 db which includes a linked
> server.
>
> A pass through query like "select * from linkedtable" works fine. But
> "select * from linkedtable where linkedtablekey=1" fails - ODBC timeout
> error.
>
> The same thing happens when I try the queries in Query Analyzer.
>
> This error only occurs on the production computer - the queries work fine
> in
> the test environment.
>
> Thanks, in advance, for suggestions.
>
> DT
>
>
>

 >> Stay informed about: Linked Server error - ODBC timeout 
Back to top
Login to vote
arno

External


Since: Apr 22, 2008
Posts: 6



(Msg. 3) Posted: Tue Apr 22, 2008 2:28 pm
Post subject: Re: Linked Server error - ODBC timeout [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> This error only occurs on the production computer - the queries work fine
> in
> the test environment.

I am no professional in Sql-Server, however, I had no problems when testing,
too. Using the productive linked servers in my case caused many, many errors
when running queries against it so I had to give up using the linked servers
directly. Instead, I use a stored procedure in SQL-Server that makes copies
of the tables from the linked server regularly (like: INSERT INTO
CopyOfTABLE SELECT * FROM LINKEDSERVER...TABLE, or with the openquery-syntax
if it does not work otherwise). Then I query the copies instead of the
linked originals. This may cause other problems, it works for me.

My linked database is a Firebird DB.

There are various errors comming from drivers or from the database that I
could not even solve with commercial driver software for firebird or the
vendor or my Firebird DB or developers from firebird. I spent many hours to
find out that sometimes different DB's do not work together (MS or anyone
else would never tell you immediately). I did not have any problems running
queries from Access to the database directly, no problems to run queries on
copies of the tables in SQL-Server (testing) - but almost nothing worked
when using the linked tables (productive).

Using linked servers, sometimes you have to convert columns, sometimes you
need the openquery-syntax (if you do not need to many apostrophes...) or
sometimes the queries just fail (because some fields "appeared" during
runtime, etc. etc.).

It's just a pain, so be prepared to face trouble.

arno
 >> Stay informed about: Linked Server error - ODBC timeout 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ODBC Linked server error. - I have setup a 'Microsoft OLE DB Provider for ODBC Drivers' linked server on my Microsoft SQL 2000 (MSDE) server. The linked server is a system DSN which connects to a informix database running on SCO unix. I can run queries, views etc on the Windows..

ODBC Timeout expired error - Some of my clients cannot access an application, and it seems there is a communication issue(?). The application server is a bit slow, the database server (MS SQL Server 2000, SQL SP4) is brand new and fast. Users that have the problem are behind a..

SQL Server query timeout via odbc - Hello all. We have an application running under several databases via odbc. One of our customers - using ms sql server 2000 - has this problem: Our application sends a query via odbc to the database and times out after a while (about 130 seconds). When....

ODBC Update on a linked table failed - Runtime error 3157 - have created a form in Access 2003 who's recordsource is a linked table from SQL Server 2000. The form has a listbox that lists all the records in that table. The form also has all the fields from that table as separate controls. I have a command..

SQL linked server with ODBC - Hi, I am having trouble extracting data from a Navision database via an sql linked server. I am using sql server 2000. The steps I have followed so far are; I installed the codbc driver, (the odbc driver which comes with navision), on the sql server. ...
   Database Forums (Home) -> ODBC All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]