473,322 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Timeout when specifying server name

Hi,

I am having real problems with timeout on queries when I specify a server and database name.
i.e. INSERT .. SQLSERVER1.DATABASE1.DBO.TABLE1
SELECT .... FROM SQLSERVER1.DATABASE1.DBO.TABLEX

The problem is that the stored procedure can be used over either 1 or 2 servers, when use over 2 servers as long as they are linked it is not an issue. If the server is the same then I timeout.

The query is actually run within an EXEC statement as we have written an application to integrate with another 3rd party application sql tables so the servers are passed in as parameters.

Example Query:
EXEC
(
'DECLARE @INDEXABLE as varchar(1)
DECLARE @DECLAREWHEN as datetime
SELECT @INDEXABLE = INDEXABLE, @DECLAREWHEN = DECLAREWHEN FROM ' + @sserver + '.' + @sdatabase + '.DBO.DOCS
WHERE DOC = ' + @sdocnum + '
UPDATE ' + @dserver + '.' + @ddatabase + '.DBO.DOCS
SET DECLAREWHEN = @DECLAREWHEN, INDEXABLE = @INDEXABLE
WHERE DOC = ' + @ddocnum)

If the databases are on the same server and the server name is ommited then the query is instant. Running over the same server specifiying a server name times out. Running over different (linked) servers then the query is slightly slower as you would expect. But there must be a better way than putting a big 'IF' around this.

TIA
Stu
Feb 18 '08 #1
1 1277
radcaesar
759 Expert 512MB
What is the version of ur SQL SERVER ?

Actually, i had wrote thousands of line of T-SQLs and i don't find any issues on using the server name. Yours is strange. Try execute this query remotely using the server name (Not from this box).

Let mw know if i miss something.
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: d.jpr | last post by:
running the following script (bottom mail) results after a few minutes in an timeout error Error Type: Active Server Pages, ASP 0113 (0x80004005) The maximum amount of time for a script to...
11
by: David Berry | last post by:
Hi All. I have a SQL Statement on an ASP page that only returns 4 records. When I run it in SQL Server or Query Analyzer it runs in less than a second. When I run it from my ASP page I get: ...
7
by: Surajit Laha | last post by:
Hi, I am suffering from a strange problem! I was porting my ASP pages from one server to the other (both Win 2000 Ad. Server). While I ported the reports it is not running at all at the new...
13
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
3
by: kant | last post by:
stringA= "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;PWD=password;Initial Catalog=DB;Data Source=127.0.0.1;Connect Timeout=30" stringB = "Provider=Microsoft.Jet.OLEDB.4.0; Data...
5
by: harborboy76 | last post by:
Hi all, First of all, just want to let you know that I'm coming from Informix background, and we just recently migrated to DB2. It's been a great new learning experience. For the time being, I...
1
by: Jeff B | last post by:
I'm trying to create a simple screen scraping application and I kept getting a System.Net.WebException thrown back with a message of "The operation has timed-out." At first I thought it was some...
4
by: VB Programmer | last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When I precomile it to my web deployment project and then copy the debug files to my web server I get this problem when trying...
5
by: Masso | last post by:
Hallo to the group, my question is this: where i have to set timeout in a web application? If i set into sessionState with property Timeout="60", after 20 minutes the session is over. Always...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.