I'm running a query that is timing out for first two times and returning results on the third time.
How do I tell SQL Server to wait until the query is completed instead of timing out?
By default, the SqlCommand.CommandTimeout is set to 30 seconds. You can assign a longer duration before executing the query, or set to 0 for no timeout. (if the question refers to .Net programming)
You can also set it connection-wide in the connection string."Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=SSPI;Connection Timeout=30"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With