Do not use on any
shared computer
August 29, 2008 02:42pm pdt
 
[x]
Attachment Details

Create A Stored Procedure that will send an email to ALL the people in a database with their contacts.

Tags: Microsoft, SQL Server, 2000, Stored Procedure, VB
I am working with SQL Server 2000 and have the following Views created:

1. "vw_active_group_providers" - this view contains the following fields and data

PROVIDER_ID          FIRST_NAME          LAST_NAME          EMAIL1
128                           John                       Adams                 jadams@testemail1.com
544                           Abraham                Lincoln                 abelincoln@testemail2.com
and so on...(thousands of rows)

2. "vw_home_phone" - this view contains the following fields and data

PROVIDER_ID          FIRST_NAME           LAST_NAME           HOME         PHONE_NUMBER
128                           John                       Adams                  home          (000) 000-0000
544                           Abraham                Lincoln                  home          (111) 111-1111
and so on...(thousands of rows)

3. "vw_cell_phones" - - this view contains the following fields and data

PROVIDER_ID          FIRST_NAME           LAST_NAME           CELL         PHONE_NUMBER
128                           John                       Adams                  cell           (000) 000-0000
544                           Abraham                Lincoln                  cell           (111) 111-1111
and so on...(thousands of rows)

4. "vw_work/office" - - this view contains the following fields and data

PROVIDER_ID          FIRST_NAME           LAST_NAME           WORK/OFFICE         PHONE_NUMBER
128                           John                       Adams                  office                       (000) 000-0000
544                           Abraham                Lincoln                  office                       (111) 111-1111
and so on...(thousands of rows)

5. "vw_home_address" - - this view contains the following fields and data

PROVIDER_ID    ADDRESS_TYPE    ADDRESS_LINE1        ADDRESS_LINE2    ADDRESS_CITY     ADDRESS_STATE   ADDRESS_POSTAL_CODE
128                           home            101 Mountain Rd        NULL                       Cleveland             OH                        55432
544                           home            202 Crimson St           Apt # 343               Dallas                   TX                         75070  
and so on...(thousands of rows)

PLEASE NOTE:
 - "vw_home_address" does not have names
 - PROVIDER_ID is the only field that connects all five of the above views.


Here's what I want to achieve:

I want to create a Stored Procedure that looks at the above views and when I execute it, it should send an email to everyone in the "vw_active_group_providers" view.

The people getting the email should see the following in their email EXACTLY:

------------------------------------------------

SUBJECT: Contact Information Verification

BODY:

As part of our ongoing effort to keep your contact information updated at all times, we request you to please verify your information below.

If your contact information has changed or been updated, please click "UPDATE CONTACT INFORMATION" link to email us with your updates.

The following contact information is registered with us:

LAST NAME, FIRST NAME
ADDRESS_LINE1
ADDRESS_LINE2 <----------//Should not display if NULL//
ADDRESS_CITY
ADDRESS_POSTAL_CODE

HOME PHONE: PHONE_NUMBER
CELL PHONE:   PHONE_NUMBER
OFFICE PHONE: PHONE_NUMBER  <----------//Should not display if NULL//

UPDATE CONTACT INFORMATION <-----------//This should be a mailto link that when clicked on sends an email to corp@corporation.com with the subject line "Please Update My Contact Information" allowing the person to send an email with any updates to his/her contacts//

Thank you,
CORP Notification System
--------------------------------------------------

So gurus, can you help me create a stored procedure to do this? And if so, how can I test it first to make sure it works?

I really appreciate it.

Thanks.
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Microsoft
Question Asked By: super786
Solution Provided By: super786
Participating Experts: 2
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Author Comment by super786
Author Comment by super786:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by acperkins

Rank: Genius

Expert Comment by acperkins:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by super786
Author Comment by super786:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Assisted Solution by shadowsaint
Assisted Solution by shadowsaint:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by super786
Author Comment by super786:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by super786
Accepted Solution by super786:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628