MS SQL Timeout problem

  • sjjs
  • Born
  • Born
  • sjjs
  • Posts: 4

Post 3+ Months Ago

Hi,

This works fine:

SELECT * FROM mytable
where fIndex = '12345'

But this times out:

UPDATE mytable
SET fEmail = 'me@mydomain.com'
WHERE fIndex = '12345'

Any ideas? fIndex is indexed and I also added an index to fEmail.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • JohnDeW
  • Newbie
  • Newbie
  • JohnDeW
  • Posts: 9

Post 3+ Months Ago

Is findex integer or char? How many rows in mytable?

Try this:
UPDATE mytable
SET fEmail = 'me@mydomain.com'
WHERE fIndex = 12345

If running from query analyser, increase query time-out. may or may not help.

Select tools/options and then select Connection tab. Then increase value for 'Query Timeout' parameter.
  • JohnDeW
  • Newbie
  • Newbie
  • JohnDeW
  • Posts: 9

Post 3+ Months Ago

Changing the timeout parameter usually just masks the problem. When you look at the query plan of the update statement in query analyzer (paste the query in query analyzer and hit CTRL-L) what does it show?
  • sjjs
  • Born
  • Born
  • sjjs
  • Posts: 4

Post 3+ Months Ago

Thanks for your suggestions, guys. In the end it turned out to be something slightly different.

The previous lines of code opened the SAME record to get some details from it; this recordset was not closed when I tried to do the update so it was, presumably, locked out. All I did was close the recordset and then perform the update and it all worked.

I will allow myself to sleep now.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 76 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.