slow sql from time to time

Posted on 2014-08-08
Last Modified: 2014-08-11
I was wondering if EE could give me some directions.  We have a database that will hang from some to time, there is no pattern.

When a user logs in, there is a update statement that will log the time, most of the time, it is fine, but sometimes, after user clicks on OK after entering username and password, it will take over a min to login, once it is in, everything is normal again.  I donot know what would cause this.  This is the test server which mean there is only 2 people are on the server.

Question by:mcrmg
    LVL 10

    Expert Comment

    Please check if any SqlCommand has been run during the logon time. If yes, further check if you can add index to the table.
    LVL 35

    Expert Comment

    by:David Todd

    Has the database got autoclose set to true?

    Is this every user? What happens if there is a user already logged in?

    What is page-life expectancy like? That is, are these pages being purged from the cache?


    Author Comment


    Where can I see the setting?  thanks
    LVL 35

    Accepted Solution


    In the database properties, go to the option tab.

    Or the other thing is have you done database maintenance - rebuilding/defragging indexes etc? Has it been a while? That could be causing slow downs. Or is the login-tables needing to be pruned? (Because the application wasn't designed for tables this big ...)

    LVL 5

    Assisted Solution

    Since you say sometimes it works fine, Check whether the tabel is locked.
    In these case a user has to wait till the tabel is unlocked or if the waiting time exceeds the limit
    it will get "time out also..

    To view the locked table use the command sp_lock in the query analizer or SSMS active monitor..

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now