MS SQL Timeout problem

  • sjjs
  • Born
  • Born
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 4
  • Status: Offline

Post February 16th, 2004, 2:01 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 16th, 2004, 2:01 pm

  • JohnDeW
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 9
  • Status: Offline

Post February 16th, 2004, 7:00 pm

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
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 9
  • Status: Offline

Post February 16th, 2004, 7:22 pm

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
  • No Avatar
  • Joined: Feb 16, 2004
  • Posts: 4
  • Status: Offline

Post February 18th, 2004, 9:19 am

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 151 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.