Click here to Skip to main content
12,950,832 members (57,601 online)
Rate this:
Please Sign up or sign in to vote.
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 0:46am
Santhosh Kumar J 7-Aug-12 6:56am
You want to run these query daily?
Rkchowdary111 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 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 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 7-Aug-12 7:16am
thank you
aarti meswania 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,984
CHill60 3,460
Maciej Los 3,053
Jochen Arndt 1,975
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2017
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