I want to delete row in SQL database when a column value matches with current date.
I have created a scheduled job for deletion of data using SQL Server Management Studio. I have followed step as shown in Video
Here Type of script is T-SQL and command I have given is:
Delete from NewDB.dbo.Datetabel where Date=getDate();
COMMIT
I want to schedule this job on daily basis. But now for testing purpose I have given on hourly basis. But this job is failed.
Where will I get the details of Error. I am working on sql2008 r2
What should be reason for failure?
Edited:
Now job is getting success when code is changed as:
BEGIN TRAN
Delete from NewDB.dbo.Datetabel where Date=getDate();
COMMIT;
But Data is not deleted from the tabel.
What may be issue now?
Thanks in advance.
1 Answer