473,386 Members | 2,129 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,386 software developers and data experts.

Set timeout for a stored procedure across a link to another server

10
SQL Server 2000, VB.Net 2010
I am executing a stored procedure from VB.Net in a database on one server, linking
to a database on another server. There are about 380 million rows in the table on
the other server. I select on the primary key, an int, to start with a value just
before the most recent three months. I also select on a datetime index for a date
range of one month.

When I run the stored procedure in SMS (2008), it gets results in about two minutes,
returning about 6.7 million records. When I run it with the VB program, it times
out in about 30 seconds. Setting the timeout longer on my connection string to
the database I am running in has no effect.

Is there a way to increase the time before timing out?
Mar 13 '12 #1
5 3572
ck9663
2,878 Expert 2GB
Try to see first why it's returning longer than usual. It's probably because of the double-hop you're doing on the second server.

Good Luck!!!

~~ CK
Mar 13 '12 #2
MLarsB
10
Thanks.

The same stored procedure which runs in 2 minutes in SMS will not complete in 30 seconds through VB, with the same parameter values. It would seem the server hops would be the same for the two cases.

If I could set the timeout to 3 minutes the call in VB would most likely work.
Mar 13 '12 #3
ck9663
2,878 Expert 2GB
Try to isolate your problem. Remove all portions that links the two server and see how fast it will return. If it still returns more than a minute then it's the problem is somewhere else.

Good Luck!!!


~~ CK
Mar 14 '12 #4
MLarsB
10
Thanks, but the first thing is does is select across the linked server. The rest is selects on the records it had brought over.

I have asked the DBA's to do as suggested on another site:
You can set the time out on a specific linked server if you use the sp_serveroption system procedure with the query timeout option.

I have not heard back from them yet.
Mar 14 '12 #5
MLarsB
10
Mystery solved:

As suggested in a reply to my question, I set cmd.CommandTimeout = 600, where cmd is Dim'd as a SQLCommand.

I would have found this before if VB itellisense had offered that property. The next time I typed in cmd., in another part of the program, this property and others were listed by intellisense which had not been listed before.

Thanks to everyone who responded.
Mar 15 '12 #6

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

Similar topics

2
by: Vikram | last post by:
Hi, Is it possible to write a Stored Procedure which can update the data from one SQL Server to another SQL Server ? I know its possible through DTS, but want to know if its possible using a...
1
by: Bill | last post by:
I am having some serious performance problems resulting from too many round trips on the wire in order to populate several tables in an ADO.NET DataSet. I would like to make ONE stored procedure...
1
by: robin via SQLMonster.com | last post by:
I've tried several different way to execute a oracle stored procedure from a DTS package but to no avail. I have a Linked Server setup which does bring back Oracle tables from the server when I...
4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
2
by: trialproduct2004 | last post by:
Hi all, i am having application which is using stored procedure written in sql server. I want to develop multithreaded applicaton. The store procedure is returing list of rows of table. what i...
1
by: Crazy Cat | last post by:
I'm calling several SQL Server 2005 stored procedures from Visual Basic 2005. I've got one stored procedure that locks up at the same point everytime, but if I copy the stored procedure from the...
4
by: Mikael.Bergstrand | last post by:
I can't execute my stored procedure from .NET (I think it might be because the stored proc has joins in it via linked servers). I get timeout error from .NET MyBase.connString ="Integrated...
1
by: Ed Murphy | last post by:
One of my clients has a stored procedure on their secondary server that copies a bunch of data from the production server. (Replication will break the accounting software, according to its...
0
by: DR | last post by:
what are the memory caps for threads running as a CLR stored procedure executed by sql server 2005? is it limited by OS only or also by sql servers memory limits? e.g. lets say my clr stored...
1
by: Weltzy | last post by:
Hi, I am new to SQL SERVER 2005 and want to do the following using VB6: Set lvWrks = CreateWorkspace("", "sa", "bulemia22", dbUseODBC) Set cns =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.