Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL-Server-2008
i want a delete query for deleting the multiple tables data on daily basis..i.e,the data will be delete every 24 hrs...
these are my sp's
delete from Appointment Where UserId='5effd331-3fa4-4ef4-a358-40babc2890c8'
delete from Campaign where ProviderId='5effd331-3fa4-4ef4-a358-40babc2890c8'
delete from Contact where ProviderId='5effd331-3fa4-4ef4-a358-40babc2890c8'
delete from CompanyProduct where ProviderId='5effd331-3fa4-4ef4-a358-40babc2890c8'
delete from CompanyProvider where CreatedUserId='5effd331-3fa4-4ef4-a358-40babc2890c8'
please help me....
thanks and regards,
your's rk
Posted 7-Aug-12 1:46am
Santhosh Kumar J at 7-Aug-12 6:56am
You want to run these query daily?
Rkchowdary111 at 7-Aug-12 8:06am
ya...every 24 hours

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rkchowdary111 at 7-Aug-12 7:11am
thank you...i don't want to backup this data..i wanna to completely remove data from tables...This is the demo data
aarti meswania at 7-Aug-12 7:14am
job is not only used to take backup
sql-Job simply mean perform assigned task on time.
you can run sql statements, execute stored-procedure on specific time using sql- Job.
Rkchowdary111 at 7-Aug-12 7:16am
thank you
aarti meswania at 7-Aug-12 7:19am
while creating job you will see there 'Command' (one big textbox) in that textbox paste your query or if using store-procedure then use "exec sp_name @param1='a'...".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100