web
You’re offline. This is a read only version of the page.
close
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 86

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

I have the same question (0)
  • RockwithNav Profile Picture
    8,295 Super User 2025 Season 2 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.

  • ManishS Profile Picture
    86 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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,237

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,425

#3
Sumit Singh Profile Picture

Sumit Singh 2,907

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans