6/15/2015

Starting and Stopping MS SQL Server from bat file

Start SQL Server:
@echo off

sc query "MSSQL$SQL01" | find /I "STATE" | find "STARTED"
if errorlevel 1 goto :start
goto :end

:start
net start "MSSQL$SQL01"
net start "SQLAgent$SQL01"
rem net start "MSSQLFDLauncher$SQL01"
net start "SQLBrowser"
net start "SQLWriter"

:end

Where clause for condition node in workflow for definition related records in not final status

For TICKET:
(select count(1) from ticket where origrecordid = :ticketid and origrecordclass = :class and status not in ('CLOSED', 'RESOLVED')) = 0
and
(select count(1) from workorder where origrecordid = :ticketid and origrecordclass = :class and status not in ('CLOSE', 'REJECTED', 'CAN', 'FAILPIR', 'COMP', 'FAIL', 'REVIEW')) = 0
For WORKORDER:
(select count(1) from ticket where origrecordid = :wonum and origrecordclass = :class and status not in ('CLOSED', 'RESOLVED')) = 0
and
(select count(1) from workorder where origrecordid = :wonum and origrecordclass = :class and status not in ('CLOSE', 'REJECTED', 'CAN', 'FAILPIR', 'COMP', 'FAIL', 'REVIEW')) = 0

6/03/2015

SQL query for searching responsible person group for classification looking from bottom level to top level classification tree

If you want to define common responsible person group for all child classification elements hierarchy from top to down element, by defining responsible person group only for one top classification element, you can use the following sql query to define relationship for the object (e.g. TICKET, WORKORDER etc., all objects which has classstructureid attrribute) with persongroup object.