This code checks if the table 'MIS_SFL_ScheduleTracker' exists in the...

April 23, 2024 at 06:16 AM

If OBJECT_ID('MIS_SFL_ScheduleTracker') Is Null Create Table MIS_SFL_ScheduleTracker (Pk_Id int identity(1,1),ReportDate Datetime ,MisTran_Status char(1),MisTran_Start datetime,MisTran_End datetime ,CollDataPull_SCUF_Status char(1),CollDataPull_SCUF_Start datetime,CollDataPull_SCUF_End datetime ,CollDataPull_STFC_Status char(1),CollDataPull_STFC_Start datetime,CollDataPull_STFC_End datetime ,CollDataPull_Cons_Status char(1),CollDataPull_Cons_Start datetime,CollDataPull_Cons_End datetime ,BizData_Status char(1),BizData_Start datetime,BizData_End datetime ,DepData_Status char(1),DepData_Start datetime,DepData_End datetime ,DepSTFC_Status char(1),DepSTFC_Start datetime,DepSTFC_End datetime ,DepSCUF_Status char(1),DepSCUF_Start datetime,DepSCUF_End datetime ,DepSTFC_Chnl_Status char(1),DepSTFC_Chnl_Start datetime,DepSTFC_Chnl_End datetime ,DepSCUF_Chnl_Status char(1),DepSCUF_Chnl_Start datetime,DepSCUF_Chnl_End datetime ,BCD_Base_Status char(1),BCD_Base_Start datetime,BCD_Base_End datetime ,PevCollPull_STFC_Status Char(1),PevCollPull_STFC_Start DateTime,PevCollPull_STFC_End DateTime ,PevCollPull_SCUF_Status Char(1),PevCollPull_SCUF_Start DateTime,PevCollPull_SCUF_End DateTime ) Truncate Table MIS_SFL_ScheduleTracker Insert Into MIS_SFL_ScheduleTracker (ReportDate) Values (Convert(Date,GetDate())) If OBJECT_ID('MIS_SFL_ScheduleTracker') Is Null Create Table MIS_SFL_ScheduleTracker (Pk_Id int identity(1,1),ReportDate Datetime ,MisTran_Status char(1),MisTran_Start datetime,MisTran_End datetime ,CollDataPull_SCUF_Status char(1),CollDataPull_SCUF_Start datetime,CollDataPull_SCUF_End datetime ,CollDataPull_STFC_Status char(1),CollDataPull_STFC_Start datetime,CollDataPull_STFC_End datetime ,CollDataPull_Cons_Status char(1),CollDataPull_Cons_Start datetime,CollDataPull_Cons_End datetime ,BizData_Status char(1),BizData_Start datetime,BizData_End datetime ,DepData_Status char(1),DepData_Start datetime,DepData_End datetime ,DepSTFC_Status char(1),DepSTFC_Start datetime,DepSTFC_End datetime ,DepSCUF_Status char(1),DepSCUF_Start datetime,DepSCUF_End datetime ,DepSTFC_Chnl_Status char(1),DepSTFC_Chnl_Start datetime,DepSTFC_Chnl_End datetime ,DepSCUF_Chnl_Status char(1),DepSCUF_Chnl_Start datetime,DepSCUF_Chnl_End datetime ,BCD_Base_Status char(1),BCD_Base_Start datetime,BCD_Base_End datetime ,PevCollPull_STFC_Status Char(1),PevCollPull_STFC_Start DateTime,PevCollPull_STFC_End DateTime ,PevCollPull_SCUF_Status Char(1),PevCollPull_SCUF_Start DateTime,PevCollPull_SCUF_End DateTime ) Truncate Table MIS_SFL_ScheduleTracker Insert Into MIS_SFL_ScheduleTracker (ReportDate) Values (Convert(Date,GetDate()))

This code checks if the table 'MIS_SFL_ScheduleTracker' exists in the database. If it does not exist, it creates the table with multiple columns including status, start time, and end time for various data pull operations. It then truncates the table to remove any existing data and inserts a new record with the current date into the table.

Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node