update tbl_EVT_Events set ccLocalManager = , ccDivisionManager = where partnerType = 'CDR' and ownerType = and ownerId = and eventId = insert into tbl_SVY_Surveys( OwnerID, OwnerType, SurveyName) values (, , ) insert into tbl_EVT_Events( ownerid, ownerType, eventTypeId, eventName, partnerid, partnerType, surveyId, comments) values (, , 2, , , 'CDR', , ) insert into tbl_EVT_EventDates( eventId, eventDay, eventDate, StartTime, apptDurationMinutes ) values (, , , , ) insert into tbl_WRK_Calendars( ownerId, ownerType, linkType, linkId, calendarName ) values (, , 'EVT', , ) #SerializeJSON( oResponse )# select eventDateId, eventDay, eventDate, coalesce(startTime,'7:00') startTime, coalesce(apptDurationMinutes,'15') apptDurationMinutes from tbl_EVT_EventDates where eventId = order by eventDay update tbl_EVT_Events set eventName = , comments = where eventId = and ownerId = and ownerType = delete from tbl_WRK_Appointments where calendarId = and startTime = and partnerType = 'CDR' select cdr_dstName from tbl_CDR_Distributors where cdr_recordId = and ownerId = and fsl_tablecode = update tbl_WRK_Appointments set partnerId = , partnerType = , title = , contactId = , updateDate = , updateUserId = where calendarId = and startTime = insert into tbl_WRK_Appointments ( ownerId, ownerType, calendarId, startTime, partnerId, partnerType, contactId, duration, durationUOM, createUserId, createDate, updateUserId, updateDate, title, userId ) values ( , , , , , , , , , , , , , , 0 ) update tbl_SVY_Questions set questionPrompt = where questionId = and questionName = 'EVENTQUESTION' update tbl_SVY_SurveyQuestions set sortOrder = where surveyId = and questionId = delete from tbl_SVY_Questions where questionId = and questionName = 'EVENTQUESTION' delete from tbl_SVY_SurveyQuestions where surveyId = and questionId = insert into tbl_SVY_Questions ( ownerId, ownerType, questionPrompt, questionName, maxSelections ) values ( , , , , 1 ) insert into tbl_SVY_SurveyQuestions ( ownerId, ownertype, surveyId, questionId, sortOrder, answerRequired ) values ( , , , , , )