Above is my stored Procedure. I need to delete records in ' EmployLog ' table selected from ' EmpMainTable '. here i need to delete older data more than 1 month (@days parameter).
How i need to select old records from one table and delete from another table in a single stored procedure.
I have attached my table and stored procedure is below.
CREATE PROCEDURE usp_DeleteEmployeeRcord
Where created < DATEADD(dd, -@days, GETDATE());
indent preformatted text by 4 spaces