SELECT server, userName, password, port FROM tbl_wrk_connections WITH (nolock) WHERE connection = ; select case when datediff( minute, max(historytime), getDate() ) > 60 then 'true' else 'false' end inError from tbl_SYS_EventProcessingHistory with (nolock) #variables.message# #variables.message# select batchId from tbl_EAI_inboundBatches with (nolock) where cfScheduleTime is not null and startTime is null and status = 'SCHEDULED' and datediff( second, cfScheduleTime, getDate() ) > 1800 #variables.message# #variables.message#