• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 61
  • Last Modified:

Trubleshoot SQL timeout message

I have a very basic program that reads a csv file into a SQL table, runs a couple of queries on that table and then reads that data and writes the converted data back to an output csv file.  On my development computer all works fine. However, when I drop it into production right after reading in the data I get this exception error message:

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0

        private void btnScrub_FileClick(object sender, EventArgs e)
        {
            lblProcessing.Text = "Processing starting ... please wait.";

            Application.DoEvents();

            Input_CSV_File();     /* Insert the data into SQL */

            Update_Codes();

            Output_CSV_File();      /* Extract the data from SQL and write only required fields to the csv file */

        }


Please cancel this question. I ran the query directly in SQL and discovered their tempdb was consuming all the disk space.

I do not know how to even troubleshoot something like this. I have increased the connection timeout for the SQL connection but that cannot be it because I open it and leave it open until the routine closes. I am wondering if it has something to do with the Application.DoEvents method? I do have a progress bar in the code and use this to see the progress bar progress. By the way, the production computer is much slower than my development computer. In development the entire process takes about 60 seconds. In production it takes about 12 minutes.
0
rwheeler23
Asked:
rwheeler23
  • 2
1 Solution
 
Máté FarkasDatabase Developer and AdministratorCommented:
Some comments:
- You should debug which step takes longer or timed out ( Input_CSV_File, Update_Codes or Output_CSV_File)
- You should increase command timeout instead of connection timeout
- You should make sure that your process streams data from CSV into database instead of parsing/loading the entire file into memory first
- You should monitor processes on server side during this program with SELECT * FROM sys.sysprocesses
0
 
rwheeler23Author Commented:
Good tips.  I actually ran the update query directly in SQL and it crashed there as well because the tempdb grew to a ridiculous size.
0
 
rwheeler23Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now