Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Long running SQL statement in Event Viewer

(0) ShareShare
ReportReport
Posted on by 80

We just did an upgrade to CU66 Dynamics NAV 2016, We have NAS service created separately, we found below event log related to NASService. Also heart beat of Job Queue is not getting update at the first instance when the service starts, in the next try it gets updates.  

Server instance: LiveNAS
Session type: UnknownClient
Session ID: 2
Action completed successfully, but it took longer than the given threshold.
Execution time: 3876 ms
Threshold: 1000 ms
Message: Long running SQL statement
Task ID: 3
Statement: SELECT "User Code" FROM "ABC-live".dbo."Object Metadata" WITH(REPEATABLEREAD) WHERE ("Object Type"=@0 AND "Object ID"=@1)

Session type: Background
Session ID: 4
Action completed successfully, but it took longer than the given threshold.
Execution time: 1733 ms
Threshold: 1000 ms
Message: Long running SQL statement
Task ID: 3
Statement: SELECT TOP (1) "timestamp","Code","Description","Job Queue Category Filter","Server Instance ID","Session ID","Last Heartbeat","Started","Start Automatically From NAS","Start on This NAS Computer","Start on This NAS Instance","Running as User ID","Session Unique ID" FROM "ABC-live".dbo."ABC Go live$Job Queue" WITH(UPDLOCK) WHERE ("Server Instance ID"=@0 AND "Session ID"=@1) ORDER BY "Code" ASC OPTION(OPTIMIZE FOR UNKNOWN)
AppObjectType: CodeUnit
AppObjectId: 448

  • ManishS Profile Picture
    80 on at
    RE: Long running SQL statement in Event Viewer

    Yes i did a check, it always takes longer time.

    We have Three Tier architecture, DB & APP are on Azure.

    Will check from SQL Profiler.

  • RockwithNav Profile Picture
    7,243 on at
    RE: Long running SQL statement in Event Viewer

    Is it taking longer then the threshold every time?

    Investigate from SQl Profiler and then check.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans