Delete EmployeeId Is Null and Age > 7 days and EmployeeId not null and Age > 30 days in table in SQL server

Acceptance Criteria : Delete EmployeeID is null and Age older than 7 days Delete FCC ComplianceHublogTeamsData Groupids is null and age>7 --Delete Supervised Hove the groupid) Tearms-Compliance records older than 30 days delete FCC ComplianceHubLogTeamsData where null Groupids-compliance-risk-res01- ngejoumal-prod and age 30

Delete Superwised Data Declare @TeamsJDL VARCHAR(90)=Select LTRIM(RTRIM(ConfigValue))) from Fcc_ConfigData where Configtame='TeamsJDL') IF(ISNULL(@TeamsJDL,'')='') Throw 5100, 'Value not found in the config table',1;

Delete Superwised Data

;With Superwiseddata as (Select * from Fcc_ComplianceHubTeamsData where GroupIds LIKE '%' +@TeamsJDL+ '%') Delete Superseideddata where DateDiff(DD,Rundate,Getdate())>30

Delete NonSuperwised Data

;With SupervisedData as (Select from dbo. FCC ComplianceHubLogTeamsData where GroupIds LIKE +'%'@Teams JDL+ '%') NotSupervisedData as
(Select from dbo FCC ComplianceHubLogTeamsData HERE Transcript_ID NOT TH(Select Transcript ID FROM SupervisedData Delete NotSupervisedData WHERE DATEDIFY DD, RunDate, ETDATE()) > 7

2 Comments

Previous Post Next Post

Contact Form