Error: Could not continue scan with nolock due to data movement, DBCC proccache will clear the probelm

SQL Server: 2008 R2 SP2
Before describing my problem, I have gone via the forum, there is no view or functions inside my stored procedure
When running a particular stored procedure inside crystal report, the error " Could not continue scan with nolock due to data movement" comes once every few weeks. After I clear the query cache plan, it works again for few weeks and the problem
comes again. During these few weeks, there is no restart or query plan clearing.
If I run the stored procedure inside SSMS, where the SQL statement is copied and pasted from SQL profiler during crystal report run, there is no error.
I discovered running in SSMS and crystal report generate 2 different query plans even I copied the SQL from SQL profiler, I have actually saved the query plans. Unfortunately, this forum does not accept attachments, or otherwise I will post my query plans
here.
There is one thing I notice about the query plan is during nested loop operation, there is a warning "no join predicate". I don't use any views or UDF in the statement, nor did I use pre-1992 ANSI join syntax. However, I did use table variables.
My guess is whether this will cause " Could not continue scan with nolock due to data movement", after I clear the cache, I run crystal report again, and I look at the plan again, the "nested loop no join predicate" warning is gone.
Running this stored procedure took 1 second maximum, even when this error is popping up, it pop up within 1 second.
DBCC checkdb has been run
The same stored procedure running by crystal report in a SQL 2008 (non r2) live environment has no problems, so I am thinking this is R2 specific problems.
The "nested loop no join predicate" error SQL statment is below, no views, no udf, but table variables
INSERT @ChequeAccount
SELECT        PS.PaySummaryID, PS.EmployeeID, PS.CostCentreID,
            (PS.GrossPay    + PS.LumpSumA + PS.LumpSumB    + PS.LumpSumD+ PS.LumpSumE+ PS.ETP+ PS.PaymentsAfterTax    - PS.DeductionsAfterTax  
 - PS.Tax- PS.ETPTax    + PS.TaxRebate) * -1 AS Amount,
            CGLM.GLAccountID
FROM Pay_Summary PS JOIN Input_Sheet ISH ON PS.InputSheetID = ISH.InputSheetID  AND  ISH.PayrollID = @binPayrollID   
AND PS.PaySummaryID NOT IN (SELECT PaySummaryID FROM @ChequeAccount)
JOIN Payroll P ON P.PayrollID = ISH.PayrollID AND P.EmployerID = @binEmployerID
JOIN CustomGLFixMapping CGLM ON CGLM.EmployerID = P.EmployerID AND CustomGLFixMappingNameID = 1 AND CGLM.CostCentreID IS NULL

The error Could not continue scan with nolock due to data movement can occur when you use the NOLOCK table hint, or use the command SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED. That is, so-called dirty reads. The error is not related to the
query plan per se, but when scanning a table, the storage engine will use an IAM scan rather than following the clustered index. If there is simultaneous activity, the storage engine may detect this and abort the operation to avoid returning incorrect data.
Or it may not detect it, and return uncommitted data or fail to return committed data.
All of these effects are transitory and they will not show up when you are alone on the system, only when there is concurrent activity in one or more of the tables in the query.
Using dirty reads is a risky business for the reasons explained above, and it takes careful analysis to understand whether you can live with the errors you can get from a particular query. The error about data movement can be handled: trap the error and
resubmit the query. But what about spurious incorrect results?
If you believe locking to be a problem, you should consider setting the database to READ_COMMITTED_SNAPSHOT
and take out all use of READ UNCOMMITTED/NOLOCK. When the database is in READ_COMMITTED_SNAPSHOT, readers read from the snapshot and only see committed data without blocking writers. This has some other effects like requiring a bigger tempdb,
and there is a risk for other types of concurrency errors, but they tend to be smaller risks.
I discovered running in SSMS and crystal report generate 2 different query plans even I copied the SQL from SQL profiler,
This is because SSMS by default runs with SET ARITHABORT ON. I discuss this in more detail in this article on my web site:
http://www.sommarskog.se/query-plan-mysteries.html
However, as I said, this problem is not related to the query plan as such, although some query plans are more susceptible to this error than others. (All plans are suscpeitble to produce incorrect results).
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Why do I get error 'Could not create temporary file. No space left on device" when I use the Engine Installati​on Wizard in TestStand?

    The process gets to the NIVISA\SETUP.INI step, then I get this error.
    I've tried with installing the MDAC and not, and it happens both times.
    The drive I'm trying to create the file to has 7.4GB open on it, so I'm not sure why this is happening.
    Thank you,
    Dave Neumann

    Dave,
    This is documented in the KnowledBase 2D6A63VW titled: "Error: Could Not Create Temporary File, No Space Left on Device".
    As RByrd suggested, you might need to free up some memory space in your System Temp directory, OR you may change the location of your System Temp directory to one with more space (such as the directory where you want the TestStand Engine files to be saved). The Knowledbase shows how to do this step by step. This is its URL:
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/46f99e55650d8d5b86256ac00059018e?O​penDocument
    Regards,
    Carlos Leon

  • Could not persist object with token:re00100000b7f6e12d419f(Error: INF)

    Post Author: saravanan rangaraj
    CA Forum: Migration to XI R2
    Hi everybody,
             I'm getting error, 'could not persist object with token:re00100000b7f6e12d419f(Error: INF)'  while refreshing reports in infoview. If I logoff and logon it's working fine. The error repeats everytime after refreshing 3-5 reports.Can anybody say why it happens?

    Post Author: saravanan rangaraj
    CA Forum: Migration to XI R2
    Hi everybody,
             I'm getting error, 'could not persist object with token:re00100000b7f6e12d419f(Error: INF)'  while refreshing reports in infoview. If I logoff and logon it's working fine. The error repeats everytime after refreshing 3-5 reports.Can anybody say why it happens?

  • Verify volume failed with error Could not unmount disk!!

    Im having weird things with my fw lacie 200gb. I come across these weird white cubes which pop up in the search mode in finder. So i tried to repair permissions of the Lacie disc and i get this sign
    Verify volume failed with error Could not unmount disk
    What is this?
    What are those white cubes in the finder?

    Hi gizeh12!
    Are you able to verify the volume of the disc (not permissions)? It could possibly be some bad/corrupt sectors on the drive. Is it a white box with a dashed line outline? Does the file size show the accurate value in "Get Info" when you click on the file?
    Are those files somewhere else as well?

  • Keep getting this on certain sites but was ok on older mac. Could not find element with id: "flashcontent"!

    Keep getting the following message on some websites on a new mac, old mac was fine.
    Could not find element with id: "flashcontent"!

    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Press and hold Shift and left-click the Reload button.
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Cmd + Shift + R" (MAC)
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    Did you copy any files from the old computer to the new computer?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    You can try to reset Firefox.
    *https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems
    Reset creates a new profile and tries to import some settings from the old profile leaving the old profile intact.
    *https://support.mozilla.org/kb/Recovering+important+data+from+an+old+profile

  • Java -version error: could not open`C:\xml_render\java\lib\amd64\jvm.cfg

    I updated my laptop to the latest recommended Java update. After installing, i tested out the install by doing a java -version. Instead of executing, i got the following error:
    Error: could not open `C:\xml_render\java\lib\amd64\jvm.cfg'
    i installed JRE under the C:\xml_render\java sub-directory. The Java installer did not create an amd64 sub-directory.
    Have tried to troubleshoot this for a few hours, could not figure out what points to `C:\xml_render\java\lib\amd64', so i would greatly appreciate some help.
    Here is version and environment info:
    Windows 7
    Installed 32-bit JRE
    java version: 1.6_38
    previously had 1.6_35, 32-bit, which i had uninstalled.

    This sounds like you already had Java installed, then installed a new one, but the old one is still in your PATH, or the Windows registry is pointing to the wrong one.
    follow the links...
    http://forum.java.sun.com/thread.jsp?forum=54&thread=184728
    http://java.sun.com/j2se/1.3/install-windows.html#Environment
    good luck!

  • Preferences Error: Could not load Sharing preference pane.

    G'Day Folks,
    I'm getting a 'Preferences Error: Could not load Sharing preference pane.' when I try to launch "Sharing" from the System Preferences.
    Have rebuilt permissions etc.
    Was hoping the 10.5.1 update might fix it, but alas no.
    Any suggestions?
    Cheers!

    Now the plot thickens...
    I notice that the version number of my 'SharingPref.prefPane' file is 1.3.1 (dated late 2006). This is odd - since I installed Leopard initially as a clean install (drive erased and formatted before installing). I did experience some instabilities a few days after this clean install, so I then reinstalled, but the second installation was an 'Archive and Install'. I cant see how a file dated 2006 managed to get into the system.
    When I checked the 'Previous Systems' folder created by by the 'Archive and Install' process, the SharingPref.prefPane' file is version 3.0 (dated 27/09/07).
    So this seems to be indicating the possible problem - the 'new' SharingPref.prefPane' file is version 1.3.1 whilst the previous system is version 3.0.
    Is your version of the SharingPref.prefPane' file version 1.3.1 or 3.0?
    Bizarre. I'll investigate further. Any contributions or advice warmly welcomed!
    Can anyone share any light on this?

  • "Could not complete scan" error when using Windows Fax and Scan

    "Could not complete scan" error when using Windows Fax and Scan with a HP OfficeJet Pro 8600 Plus All-In-One network printer.
    Printing is fine.
    When using the HP Scan application, get the error "Scanner communication cannot be established".
    When scanning from the printer itself it fails with the same message. In addition the printer panel displays the error:
    "The scan could not be completed due to one or more of the following issues:
    Connection to the computer is lost
    The scanner is in use
    OCR application is not installed"
    My PC is a HP Compaq Pro 6300 SFF 64bit, with ethernet cable to the router and ethernet cable to the printer
    Originally ran Windows 8.0; recently upgraded to Windows 8.1.
    Older separate Netgear router and modem was replaced with a newer Netgear Router/Modem, but both experienced the same problem.
    There was no problem with the original Windows 8.0 configuration and only after upgrading to 8.1 did the problem emerge.
    On my home netowrk I have an HP ProBook 6550b running Windows 7 sp1 that uses wireless to get to the Router, and it has no problem with scanning.
    I have followed the recommendations of a number of articles relating to this issue (including: http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&​lc=en&docname=c02915410&product=4323659#N94), but there has been no change in behaviour.
    The printer has a static IP address;
    Power settings have been adjusted to Never for Turn off Hard Disk; Sleep and Hybrid Sleep.
    Scanning has been tested with all firewalls and antivirus turned off and in Selective Startup.
    The printer has been plugged directly into the power socket.
    With all these settings the Windows 8.1 cannot scan while the Windows 7 laptop with wireless to the router has no problems.
    Appreciate any insights into this problem.
    I can only surmise that the problem is a compatibility problem between the 8600 Printer and Windows 8.1.
    Any ideas?
    regards,
    Motorbike

    You can determine if there is compatiblity between the printer and PC by checking the Windows 8.1 hardware compatibility list. I have done that and it is shown to be fully compatible.  If the driver you installed before was only the basic driver,it would explain the lack of scan and copy functionality.
    Download and install the Windows 8.1 full feature driver and software on the HP Compaq Pro 6300 SFF 64bit PC . 
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloa​dIndex?softwareitem=bi-108858-4&cc=us&dlc=en&lc=en​...
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Session closed due to Error: Could not Resolve hos...

    Hi,
    I''m trying to sort out connection issues for my auntie. She has a BT Homehub 5 with the latest firmware.
    However, she is suffering from reboots and lost connections all the time. I have reviewed the log files and it is full of the following messages:
    74.270000 CWMP Session closed due to error: Could not resolve host
    Any ideas as i am stumped. Its a fairly recent installation ( 4 months or so) and she has only recently started to use the Wifi. It was ok when wired.
    Simon

    If it is DEFINITELY a wireless problem only, then download InSSider and run the program. This will tell you if you have are using a congested wifi channel.......
    You can then go into the settings and after picking a less congested channel, turn off the "smart wireless" setting.....
    Although the wireless problem wouldn't cause the rebooting problem......
    If you found this post helpful, then please click the star on the left, after all, I'm only trying to help........

  • BME-99003:  An error occurred, so processing could not continue.

    Got the error message below when working with my faces-config.xml file.
    I currently have several JSF navigation cases labeled as "!NLS Error" (No Quotes)
    Steps to create the error...
    1. Create an ADF Faces project with 10-15 pages and navigation rules between each page.
    2. Outside of JDeveloper, redo your folder structure on how you store your pages.
    3. Inside Jdeveloper, update the source of faces-config.xml to point to the new location of the files.
    4. Click on the diagram tab.
    On my screen, the diagram for both the old and new files was appearing. When trying to delete the diagram for the old files, I got the error message. I cannot save the file faces-config.oxd_faces.
    Message
    BME-99003: An error occurred, so processing could not continue.
    Cause
    The application has tried to de-reference an invalid pointer. This exception should have been dealt with programmatically. The current activity may fail and the system may have been left in an unstable state. The following is a stack trace.
    java.lang.NullPointerException
         at oracle.bm.diagrammer.shape.BaseDiagramEdge.startMove(Unknown Source)
         at oracle.bm.diagrammer.track.MoveTracker.<init>(Unknown Source)
         at oracle.bm.diagrammer.track.SelectionTracker.mousePressed(Unknown Source)
         at oracle.bm.diagrammer.track.ModularTracker.processEvent(Unknown Source)
         at oracle.bm.diagrammer.track.SelectionTracker.processEvent(Unknown Source)
         at oracle.bm.diagrammer.track.TrackerStack.processEvent(Unknown Source)
         at oracle.bm.diagrammer.BaseDiagramView$53.processEvent(Unknown Source)
         at oracle.bm.diagrammer.PageView$PageViewPanel.fireEvent(Unknown Source)
         at oracle.bm.diagrammer.PageView$PageViewPanel.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Action
    If further errors occur, you should restart the application.
    Also, report the problem on the JDeveloper forum on otn.oracle.com, or contact Oracle support, giving the information from this message.
    ________________________________________________________________________________

    To fix this issue, I performed the following...
    1. Copy the xml from the faces-config source tab.
    2. Delete the faces-config.xml file within JDeveloper.
    3. Create a new faces-config.xml file.
    4. Paste xml from step one into the faces-config source tab.
    Really not that bad of an issue, I only posted because the error message directed me to.

  • Is my HD Dead? Reformat Disk Utility Error: secure disk erase failed with the error could not open disk.

    Hi,
    Fed up with seeing the spinning beach ball I decided to reformat my MacBook Pro...
    After backing up everything on an external hard drive I put in the OSX install DVD, restarted the machine and held down 'C'.
    I followed the install prcedure, clicking next a few times etc...
    I then went into Utilities > Disk Utility. I chose 7-Pass to erase the Macintosh HD and set it off erasing.
    I checked the process an hour in and message on screen read:
    Secure disk erase failed with the error:
    could not open disk
    The internal hard drive no longer exists in the disk utility so I cant retry erasing it.
    The only thing that appears in disk utility is the OSX install DVD.
    I can't even shut down the mac as everything under the apple tab is greyed out!
    I'm guessing this means my hard drive is broken right?
    If anyone has any other ideas of what to try I'd really appreciate that.
    How do I turn the machine off?
    If my hard drive is gone then should I consider getting an SSD drive?
    Any recommendations for such a drive would be great.
    Hope you can help!

    Did you partition the drive?
    Extended Hard Drive Preparation
    1. Open Disk Utility in your Utilities folder. If you need to reformat your startup volume, then you must boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger or Leopard.)
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Click on the Options button, set the partition scheme to GUID (only required for Intel Macs) then click on the OK button. Set the number of partitions from the dropdown menu (use 1 partition unless you wish to make more.) Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the volume(s) mount on the Desktop.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    Steps 4-6 are optional but should be used on a drive that has never been formatted before, if the format type is not Mac OS Extended, if the partition scheme has been changed, or if a different operating system (not OS X) has been installed on the drive.

  • ERROR: could not serialize access due to concurrent update

    Hi.
    I use ejb+glassfish+postgres in my project.
    The project is a web application for finansial data transfering.
    I have three DBs, long global transactions, serializable isolation level, container-managed transaction.
    When i test the project with concurent threads, i get an exception: "ERROR: could not serialize access due to
    concurrent update"
    I read that when you get suck kind of error, your program must rollback current transaction and then reply this transaction.
    what do i need to do to complete this transaction? :
    1) rollback and reply transaction
    2) maybe, the are other ways to reply transaction (for example: glassfish configurations, ....)
    Edited by: 856539 on 04.05.2011 8:10

    If your DAO is nicely separated from your service layer as it should be then the solution I suggested above works and doesn't require you to change many classes because you can catch the expection in the DAO layer and do the retry in the DAO layer. That's where the solution belongs too because it's only applicable for your current database solution (Postgres). i.e If you change your database solution you need to change your DAO anyway, but only your DAO. If you put the solution in your service layer (or client layer) then you need to change those layers when you change your database solution which defeats the purpose of the separation.
    If you still want the interceptor approach, you need to check if the transaction has been marked for rollback back, then you need to join the transaction with EM.join and from there you attempt to close and discard the joined transaction before starting another one to invoke the retry operation on. Bear in mind that you only do the rety when the transaction was marked for roll back because of that specific exception. Needless to say that this doesn't seem to be a clean way to handle your transactions (if you can get it to work that is).

  • I was trying to upgrade my iPhone 45 to 5.0.1 OS and received an error, "could not update due to firmware file not compatible".  I have Windows PC

    No success upgrading iPhone to iOS 5.0.1.  Received an error, "could not update due to firmware file not compatible".  I have a Windows pc.  Help??

    Check that and also their is a windows update. Update and try again. email me if you have the same problem I'd be happy to keep helping you with this problem
    < Email Edited By Host >

  • Fiori leave request error "Could not start the app due to an internal error"

    Hi,
    I'm getting this error "Could not start the app due to an internal error" when accessing leave request application.
    I don't get this error when I login and launch the app for the first time. when I go back to the home screen and select "My Leave Requests" app again, I get this error.
    If I close the error message and do a browser refresh, everything is fine again for the first time, if I access the LR app again- same error .
    Other apps are working fine.
    I don't see any error in gateway or App logs.
    below is the Request URI
    /sap/opu/odata/UI2/INTEROP/ResolveLink?linkId=%27LeaveRequest-createLeaveRequest%27&shellType=%27FLP%27&formFactor=%27desktop%27
    Service call info
    Anyone with similar issue? any SAP notes?
    we are on
    UI2_731        100    0009    SAPK-10009INUI2731        SAP UI2 IMPL. FOR NW 7.31
    UI2_FND        100    0009    SAPK-10009INUI2FND        SAP UI2 FOUNDATION
    UI2_SRVC    100    0009    SAPK-10009INUI2SRVC        SAP UI INTEGRATION SERVICES
    UI5_731        100    0009    SAPK-10009INUI5731        SAP UI5 TEAM PROVIDER ON 731
    UISAPUI5    100    0009    SAPK-10009INUISAPUI5    SAP UI5
    UI_INFRA    100    0009    SAPK-10009INUIINFRA        SAP UI INTEGRATION INFRASTRUCTURE
    UIX01HCM    100    0003    SAPK-10003INUIX01HCM    UI for HCM Application
    Tags edited by: Michael Appleby

    Hi Masa,
    We have required SAP notes now, we are on version 1.22.5.
    It is still the same, working the first time I access the App, but subsequent access wont work until i refresh browser.
    I've include the response and lpd/tile screens.
    Thanks,
    Phani

  • I want to backup my phone before upgrading to ios5 but I get an error message itunes could not back up the iphone because a session could not be started with the iphone. Please help me..

    I want to backup my phone before upgrading to ios5 but I get an error message: itunes could not back up the iphone because a session could not be started with the iphone. I want to go to ios5, but I do not want to lose everything. I've gone to my device under preferences and I have no backup currently.
    I have a Verizon Iphone 4 and a PC.
    Please help me..

    Hi Judy,
    Im using windows 7 and im not a computer wizard, i've tried the method by using the instruction for Win7 but it does not work, same problem still exist.
    Could uninstall itunes and reinstall it back on my pc fix my problem, please advise...... Many Thanks!
    VBR,
    ray

Maybe you are looking for

  • How to calculate Average balance for an account

    Hi, How to calculate average balance for an account for a particular period say for JAN-12 period and after the end of that period for another two days 01-feb-12 and 01-feb-12 ? I'm using the following query : SELECT cc.segment1||'-'||cc.segment2||'-

  • Sound effects not working

    Suddenly my iPad 3 with Retina display isn't playing sound effects in many apps. Music and videos playback audio fine. Sound effects in the Settings app work fine. I can change the sound effect for sending Mail through the Settings app and hear what

  • How do I get my music off of my Ipod onto my Iphone?

    I need help

  • Will i need a case or screen protector for iphone 5

    will i need a case or screen protector for iphone 5? heard the glass is tougher, but still concerned about scratches.

  • Concatenation of row data into a single row

    Hi, I have table which has the data in the following way.   col1          col2    col3   a             1       one   a             2       two   a             3       three   b             1       dfdf   b             2       sfdhh   c             1