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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Not sure the best way of doing this?

Author  Topic 

daniel.newman@bis-web.net
Yak Posting Veteran

71 Posts

Posted - 2001-09-18 : 06:50:46
Hello,

I have a database with 8 tables in it. Four of these are four registrants, and the other four are for job positions.

What I want it to run a file (vbs) every night, that will send an email message to everybody within the registered users table about new jobs posted in the other tables.

My choices:
1. I open up a recordset of all of todays jobs, and scroll through it matching users to jobs. This is probably the easiest option, but if I have one user who's interested in lots of jobs, it's possible that person may receive many seperate emails from me. This is what I'm trying to avoid.

2. Create a temp table joining the users tables, and then matching this to todays jobs. I'd then need to scroll through the recordset bringing all of the same users jobs togather, and sending them a summary.

My tables are like this:

Vacancies::
RefNo varchar(10)
JobTitle varchar(255)
whShort varchar(6)
typeID int
locID int

Interest_Address::
UserEmail varchar(255)

Interest_WorkingHours::
UserEmail varchar(255)
whShort varchar(6)

Interest_Location::
UserEmail varchar(255)
locID int

Interest_JobTypes::
UserEmail varchar(255)
typeID int

So, would creating a temp table of::
UserEmail
whShort
locID
typeID

be a suitable way to search against the Vacancy table?

SELECT * FROM vacancies INNER JOIN #temp WHERE #temp.whShort = vacancies.whShort AND...

Any advice on which is the best way to and do this would be most useful.

Thanks

   

- Advertisement -