Aller au contenu principal

Recherche

Recherche

DB delete old records error Incorrect syntax near '-'.

Commentaires

3 commentaires

  • Avatar
    Xabier Clemente
    Modérateur

    Hi David!

    Thank you for sharing your issue in the Community Forums!

    The error message we are receiving points out to this being a syntax error. Has this ever worked? And if so, has anyone updated the script you are using?

    Please, make sure the script you are using lacks any syntax errors. If the script used to work and you have a backup or snapshot of the workstation you can revert to, we could also try reverting to this point and retrieving the old script so we can compare it to the newer one.

    You could also try the following workaround:

    1. Open SQL Server Management Studio.
    2. Download the SpDefragmentIndexes.sql SQL Script provided by our Development Team (Pastebin link to the file here).
    3. Once the file is downloaded, double click the .sql file, so it opens within SQL Server Management Studio.
    4. You can execute the script by pressing F5.

    Hopefully, these suggestions will be of use.

    0
  • Avatar
    David Mason

    Hi Xabier,

    I do not know what you mean be script, I was running the standard Bartender Administration Console - Maintenance task to delete older records.

    I updated the SpDefragmentIndexes stored procedure on the Bartender DB. Looks to a minor update with addition of brackets around the index names. 

    Will monitor over the next days to see if it is resolved.

    0
  • Avatar
    Xabier Clemente
    Modérateur

    By script, I meant the set of orders a maintenance task is given. I presume by your answer these orders were not modified then.

    The script we've implemented now should reorganize and rebuild the index if the fragmentation level is higher than the given threshold, which could be the reason we were experiencing this issue.

    Keep us posted! Hopefully, the error will be gone for good.

    0

Vous devez vous connecter pour laisser un commentaire.