Click here to Skip to main content
12,396,054 members (65,868 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

Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2016
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