Hello Everyone,
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
(
@days Int
)
AS
BEGIN
DELETE [dbo].[EmpMainTable]
Where created < DATEADD(dd, -@days, GETDATE());
END
Thanks
indent preformatted text by 4 spaces