Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

set timeout in openrowset? Expand / Collapse
Author
Message
Posted Tuesday, August 7, 2012 9:33 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 3:05 AM
Points: 48, Visits: 232
Hi all,

Is there a way to set timeout in openrowset? My project requires to connect from a sql server 2005 server to 150 databases (sql server 2000) and run some query there. Some connections may be broken. The broken connection may take 40s to timeout, the query only runs about 2 seconds. So I want to set a timeout in openrowset so the overall run time can be reduced.

Thanks.
Post #1341356
Posted Wednesday, August 8, 2012 2:09 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 3:05 AM
Points: 48, Visits: 232
so there is no way?
Post #1341721
Posted Wednesday, August 8, 2012 9:19 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 3:05 AM
Points: 48, Visits: 232
It seems trying to add timeout in openrowset is not doable. The workaround is to try to ping to the server use xp cmdshell 'ping -n 2 -w 3000 ip' , -n means number of retries (default is 4), -w means timeout for each try (default may be 4 seconds).
Post #1341962
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse