SQL Timeout -- shouldn't happen

C

Chip

I'm running a SQL proc from the front end that times out after 10 minutes.
However, if I run the same proc directly in the Query Analyzer window, it
completes in 1.5 minutes.

Can anybody tell me what the extra overhead is, or if there is a way to
overcome this without just jacking up the timeout property?

Sub CreateReports(ByVal OrgID As Int32)
Dim con As SqlConnection
Dim cmd As SqlCommand
Try
con = New SqlConnection(ConnectLibrary)
con.Open()
cmd = New SqlCommand("CreateAllReports", con)
cmd.CommandTimeout = 600
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@orgID", SqlDbType.Int).Value = OrgID
cmd.ExecuteNonQuery()
Catch
LogAppError(Session("OrgID"), Err.Description)
Response.Redirect("error.aspx")
Finally
con.Close()
End Try
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top