4

I have a script task that executes a dynamically created SQL restore statement. This has worked without a problem for the first 6 runs, but then the .bak files grew too large to run in under 30 sec.

I have looked everywhere I can think of for a timeout option. I have reset the Connection Manager's General Timeout to 500 (from what I understand that is in seconds). None of this has worked yet.

Where / how do I set this value (or can I)?

BIDS Version Info: Microsoft Visual Studio 2008 Version 9.0.30729.4462 QFE

Microsoft .Net Framework Version 3.5 SP1

1
  • what ur saying is that do you want a "timeout" in number of attempts instead of miliseconds? Commented Mar 22, 2012 at 15:53

1 Answer 1

8

You'd need to post your code but it's most likely not the Connection Manager that is timing out but the query (they are different timeouts). Assuming you are using a SqlCommand object to run your query, set the CommandTimeout to something beyond the default 30 seconds.

Code approximately

// Set the query execution timeout to 500 seconds
mySqlCommand.CommandTimeout = 500;
mySqlCommand.ExecuteNonQuery();

Of course, you'll want to be code defensively but this addresses the crux of your need.

Sign up to request clarification or add additional context in comments.

1 Comment

No problem. If you find an answer helpful, you can click the up arrow over the answer's number. If it solves your problem, you can mark it as resolved by clicking the green outline of a check mark. Welcome to StackOverflow and feel free to bring me all your SSIS questions ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.