SQL Sever Execution time-out vs .NET SqlCommand.CommandTimeout. Who wins?
I tried to find the answer search this page and google with no luck!
If I change the "Execut开发者_如何学Pythonion time-out" on the SQL Server instance (Tools->Options->Query Execution) and sets the SqlCommand.CommandTimeout in the .NET code using the SQL Server. Which property wins?
Cheers --Jocke
Timeout is a connection-level property - it applies to each individual connection.
When you go to 'Tools->Options->Execution timeout' you affect only newly created connection in SQL Server Management Studio - it does not apply to SQL Server Instance you're running queries against.
So SqlCommand.CommandTimeout will certainly 'win'.
When you go to "Tools->Options->Execution timeout" in SSMS this sets SqlCommand.CommandTimeout for SSMS. No more, no less.
There is no equivalent setting in the SQL Server engine to SqlCommand.CommandTimeout: SQL Server will not abort a query for a command timeout because it doesn't issue the command. The client does
精彩评论