July 20, 2005 at 11:48 pm
I a couple of months i will need to make a trigger (I am not sure if i even need a trigger, maybe just a procedure) that will notifie workers of a work request from a web application.
Example would be,
Search Criteria (Between Here)
A user wanted a (PAINTER) for some (INTERIOR) work at thier home at the (ZIP CODE) OF DALLAS, TX. 75070. (Locate the nearest (4 painter's) (within 30 miles,) by (zip code)
In addition if another person from the same town was to fill out the form with the same Creteria that would not receive the last 4 painters chosen by the query, the rows would rotate and the NEXT 4 PAINTERS would get the call for work.
I have a month or so before i really need to start working with this, is there any way that we can start a disscussion on this topic, and someone tell me a good place to study up on this type of need.
Thank you,
Erik....
OH yea the workers would be notified by email...
Dam again!
July 27, 2005 at 6:40 pm
If I had this same project I would do the following:
DECLARE @temp TABLE(
Painter_ID bigint,
Distance_inMiles int,
Requestor_ID bigint,
REQ_timestamp datetime)
Select TOP 4 Painter_ID,
dbo.fnDistance_inMiles(Painter_Zipcode, Requestor_Zipcode) as Distance_inMiles, @req_id as Requestor_ID, GETDATE() as REQ_timestamp --note req_id is determined elsewhere in the proc.FROM tblPainters
WHERE DATEDIFF(hh,LastSelected_timestamp, GETDATE()) >= 1 --timestamp must be greater than or equal to 1 hour from present time.
and Painter_Zipcode = @Requestors_zipcode
GROUP BY Painter_ID
HAVING MIN(
dbo.fnDistance_inMiles) <= 30Hope this helps
Scubagirl
SCUBAGIRL
July 27, 2005 at 6:50 pm
Thank you very much! I am greatfull for the time that you have taken to write this for me! Thank very much! I am going to print this out and study it, i still have a little while before i have to implement this, so i am glad that you have helped so that i can start right away and study this.
Any helpful hints are suggestions, i look forward to them all! And sure i would like more information about the email process.
Thank YOU,
Erik...
Dam again!
July 28, 2005 at 3:29 pm
Hi Erik,
You are very welcome. I hope my plan works for you. Just remember there's always many ways to accomplish things and this is just my way. You may end up finding another method as well. If you discover any problems just post and I will try to check it now and then. Regarding the Send Mail task I didn't mean to mislead you but I know more about setting up a DTS package than using the actual Send Mail Task because we don't actually have SQL Mail turned on in our production server. I'm trying to get the Admin to get it going but we have LOTUS NOTES and he hasn't been able to set it up. If you end up doing it differently share the knowledge. Also if you haven't worked with UDF's much they are really useful and simple to set up. Don't forget to use your BOOKS ONLINE help, and Google for help also when you get stuck. (You probably already know that). One of the things I read online was that a best practice for sending mail was to use the extended stored proc called xp_sendmail. You may want to research that some more. Good luck.
Jill
SCUBAGIRL
July 30, 2005 at 10:18 am
Sorry for the late responce, I have been working on one control all week and i am just about to pull my hair out, but then again i am finally getting desired results from the little demon so i am happy.
I am very thankful for your help with the code and i look forward to working with it. And i will be tapping on your shoulder when i start implementing it.
Thanks again,
Eik...
Dam again!
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply