Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Newbie
 
Join Date: Oct 2007
Posts: 1
#1: Oct 9 '07
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's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,392
#2: Oct 9 '07

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


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
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#3: Oct 9 '07

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


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?
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,392
#4: Oct 9 '07

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


Quote:

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!
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#5: Oct 9 '07

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


... this looks more like a MS SQL problem than a MySQL problem.
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#6: Oct 10 '07

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


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.
iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,017
#7: Oct 10 '07

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


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.
Newbie
 
Join Date: Mar 2008
Posts: 1
#8: Mar 28 '08

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


Quote:

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.
Newbie
 
Join Date: Aug 2009
Posts: 1
#9: Aug 19 '09

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


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.
Reply