Monday, January 13, 2014

Nintex Database SQL Queries - Nintex Workflow Constants, Nintex Workflow Schedules

The SQL query returns Nintex Workflow constants and Nintex Workflow schedules from the Nintex Workflow database.

First I would like to start off with a PowerShell script that you can use to find a list of GUIDs for each of your site collections for use with the SQL queries. Run this command from your SharePoint management Shell:

Get-SPSite | Select Url,ID, RootWeb

Nintex Workflow Constants:
This first query will give you a list of all of the workflow constants in the 2007 DB that are not credentials.

SELECT  Title,Description,Value,Sensitive,SiteId,WebId,Type,AdminOnly
FROM [NW2007]..[WorkflowConstants]
WHERE Type != 'Credential'
ORDER BY SiteID

The next query will give you a list of [workflow constant] credentials only:

SELECT  Title,Description,Sensitive,SiteId,WebId,Type,AdminOnly
FROM [NW2007DB]..[WorkflowConstants]
WHERE Type = 'Credential'
ORDER BY SiteID

Nintex Workflow Schedule:
This last query will give you a list of all of the scheduled workflows in your environment sorted by site ID. This should allow you to target specific sites and recreate the schedules.

SELECT   SiteId,ListId,WebId,WorkflowId,ItemId,NextRunTime,Schedule,StartData,ModifiedBy,IsBroken,
IdentityUser
FROM [NW2007DB]..[WorkflowSchedule]
ORDER BY SiteID

Please run each of these queries against the Nintex 2007 database. Happy programming :)