An exception occurred while executing a Transact-SQL statement or batch

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pratha
    New Member
    • Oct 2007
    • 1

    An exception occurred while executing a Transact-SQL statement or batch

    Hi,

    i have a problem received from my client saying that she received an error that say : An exception occurred while executing a Transact-SQL statement or batch. There is no error code given in the error message. There is a additional infomation given: Timeout expired. timeout period elapsed prior to completion of the operation of the server is not responding. So can u advise me on this matter.

    Thank You.

    Regards,
    S.Pratha
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    If you have a question about mysql you might get more responses if you post in the mysql forum instead of the misc forum.

    -MODERATOR

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi Pratha. Welcome to The Scripts!

      What type of software threw this exception?
      What type of SQL server are you trying to connect to?
      What programming language is the software written in?

      Did you write any of this software yourself?
      Do you have the code that is generating the error?

      Do you have any information we can use to help you solve this?

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by Atli
        Hi Pratha. Welcome to The Scripts!

        What type of software threw this exception?
        What type of SQL server are you trying to connect to?
        What programming language is the software written in?

        Did you write any of this software yourself?
        Do you have the code that is generating the error?

        Do you have any information we can use to help you solve this?
        Atli has the patience of a saint!

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          ... this looks more like a MS SQL problem than a MySQL problem.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

            I'm going to go ahead and move this thread to the MS SQL forum, where our resident Experts will be better able to help you out.

            Comment

            • iburyak
              Recognized Expert Top Contributor
              • Nov 2006
              • 1016

              #7
              Timeout errors usually happen when something is running on the backend and doesn’t return result to meet predefined deadline.
              For example you are running a stored procedure that has to return some data to a front end application and setting on your connection says that it would wait for 30 seconds before timeout expired and error will be issued.

              So you have to do several things to investigate this issue:
              1. Check if application connects to the server with no problem.
              2. Debug application and find where timeout happens and which command is sent to the server that is taking longer then expected.
              3. Go back to the serve and see how long the same command actually runs on the server side and try optimizing if possible. It should include evaluation of a showplan and determine that you might need to create some indexes or maybe your server didn’t have maintenance for a long time and you don’t update statistics regularly. Could be a space issue or just some unattended process having exclusive lock on a table and can not release resources without intervention.
              4. On application side you can extend timeout by setting it to 0 you will set waiting time to infinite until result will actually be returned back to the front end. Make sure that it is an only option you have left by trying to fix your problem with previous suggestions.

              If everything I said here is gibberish to you try to find more experienced programmer to investigate an issue.

              Thank you and good luck.

              Comment

              • geo2tc
                New Member
                • Mar 2008
                • 1

                #8
                Originally posted by pratha
                Hi,

                i have a problem received from my client saying that she received an error that say : An exception occurred while executing a Transact-SQL statement or batch. There is no error code given in the error message. There is a additional infomation given: Timeout expired. timeout period elapsed prior to completion of the operation of the server is not responding. So can u advise me on this matter.

                Thank You.

                Regards,
                S.Pratha
                I had a similar issue when I tried to attach the NORTHWIND to my SQL server 2005 Express installed on my Vista Home. Here is what I did:
                Right Click the folder where my dB is located - > Properties - > Security Tab -> Edit --- And Select the Logon user - > Gave it Full Control on the folder. And that fixed it.
                I hope that'll help.

                Comment

                • fadhilomer
                  New Member
                  • Aug 2009
                  • 1

                  #9
                  I had a similar problem with windows vista and what i did:

                  1. Right click on my computer
                  2. click property
                  3. type "uac" in the search which is located in upper left of the window.
                  4. turn off the User Account Control (UAC)

                  I hope that'll help.

                  Comment

                  Working...