Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2009-04-08 : 14:06:39
|
| I have 2 tables that a seperate application adds data to. The application writes emails to the tables so I can make a job to send them every morning at 3amTable 1 BatchEmailSchedulebatchIDbatchNameemailDateTable 2 BatchScheduleIDbatchIDemailAddemailSubjectemailBodyemailFromSo what I need to do is run this everyday at 3 if the date = emailDate then send all emails in the BatchSchedule table.. then delete them.I have no idea even how to start this. Is there an example somewhere?DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-08 : 14:13:46
|
| 1. Create a Stored procedure2. In your SQL server create a job under the SQL Server Agent|Jobs node. Righ Mouse Click then select New Job3. Give it a name, the rest is pretty easy4. In Steps in Select a page (Far right), Select New...it should default to T_SQL. In there do EXEC [your stored procedue from step 1]<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|