Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:06:46+00:00 2026-06-02T18:06:46+00:00

I recently had a web application migrated to a different data center. That included

  • 0

I recently had a web application migrated to a different data center. That included moving the database from SQL 2000 to 2005, which shouldn’t be a problem per se (I run other instances of the same app with SQL 2000 to 2008 R2).

The problem is, after the migration some operations, especially UPDATEs, became extremely slow (timing out after whatever limit I define in my app, and I tried up to 6 minutes).

I tried running the same query on Management Studio, but the results were inconsistent. Sometimes it just runs instantly, but sometimes it takes forever and I have to cancel the query. On my app, it always time out (Classic ASP app).

It’s happening on more than one query, but most frequently on one that looks like this:

UPDATE mytable SET timestampcol = GETDATE() WHERE record_id = 12345 /* record_id is the PK */

What I tried already:

  • First, I suspected of the table size (~2M rows). So I deleted old records, leaving only ~40,000 rows, but the problem persisted.
  • Then I tried recreating my indexes, and it didn’t work.
  • I also tried running both sp_updatestats and sp_updatestats 'resample', but no luck.

So, I’m stuck. Does anyone has a clue of what might be happening, and how could I fix it?

UPDATE

Looking at sys.dm_tran_locks, I can see that two locks are in place while the query is running from my app:

request_mode        request_type    request_session_id
S                   LOCK            65
IX                  LOCK            67

I also realized the S lock appears before I try to run the query that gets stuck, on an SP call. I’m now revising the SP to try and understand why the lock persists after the SP finishes running.

UPDATE 2 – Answers to Aaron Bertrand questions (see comments)

  • Does the procedure use transactions?
    No, there are no transactions in the whole app

  • Are there any code paths where the transaction might not be committed? N/A

  • Who is calling this other stored procedure? The same script is calling it, a few lines before the problematic query

  • Are you using some kind of transaction context in .NET? No, and it’s not .NET, it’s classic asp (old legacy code I have to maintain)

  • Why isn’t the app calling stored procedures? You means instead of running the problematic query directly from (ADO) connection.execute? Well, also tried it, same result.

  • Why does calling the other stored procedure not affect you when you run the problematic query in SSMS? I have no idea! But the update is currently running just ok from SSMS, whether I call the sp before that or not.

Guys, thank you for all your help, but I’m about to give up on this. Things just worked before someone decided to move the server. The problem was just dropped on my hands, I’ll try to pass it along to someone else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:06:47+00:00Added an answer on June 2, 2026 at 6:06 pm

    This turned out to be a lock on the table. I still don’t understand why it was getting locked, but I solved it by adding the WITH(NOLOCK) hint to my stored procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently added some url re-writing to my web application and had to added
We recently had a web app that went out to site acceptance testing where
I have a system that we have recently developed - a web application over
Our team has recently migrated to git. We have production web application server with
I recently used a Java Web Start application. I launched it from my web
I have a hybrid asp.net web forms / mvc application that I recently converted
I've had the thrill recently of developing web service applications. Most of my experience
So far I have been creating Web Portal but recently I had a request
I recently had a discussion with a colleague about serialization of byte data over
I recently had to work around the different default sizes used for enumerations in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.