Skip to main content
Search Again

We think these articles could help you:

    See More

    ALERT: This site will be decommissioned at the end of December 2018. All existing and new Nintex knowledge content will be available within the new Knowledge Base area of the Nintex Community site. 

    Nintex Knowledge Base

    "Object not set to an instance of an object" When Running DetachDatabase NWAdmin Command

    Status: Validated

    When running the DetachDatabase NWAdmin command, the operation lists out sites associated with the database, and then the following error occurs:

    Command line execution error: Object reference not set to an instance of an object.
    1. Take backup of the Nintex content database being detached.
    2. Run the following query within SQL Management Studio against the Nintex content database being detached to find all SiteIds referenced in the database:
      SELECT DISTINCT CAST(siteid as uniqueidentifier) as SiteID FROM dbo.workflowinstance
    3. ​Based the SiteIds returned, determine which ID the DetachDatabase command failed on (this will be the first site or SiteId *not* listed out by the DetachDatabase command)
    4. Once the orphaned SiteId is determined, expand open the Nintex content database > Programmability > Stored Procedures
    5. Right-click on the dbo.PurgeWorkflowData stored procedure and select 'Execute Stored Procedure...'
    6. Within the window that appears, check 'Pass Null Value' for all parameters *except* for @siteid
    7. Pass @siteid the GUID of the orphaned site found in step 3, and select OK.
    8. Re-run the DetachDatabase command.
    • Was this article helpful?