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
 General SQL Server Forums
 New to SQL Server Programming
 query

Author  Topic 

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2012-07-03 : 23:40:50
i have a list of cases.

cases table have staff email address, name, group and unique domain tie to every each staff, the case number and description.

i would like to schedule to send their log cases every week to their own email address.

for example: jane only will get all cases tie to her name.

the problem is, there are 50 staffs.

how can i actually query to send it to every each email address?

X002548
Not Just a Number

15586 Posts

Posted - 2012-07-04 : 01:51:20
2 different problems

Let's start by identifying what you need to send.

How would you write a query to identify your population?

We would need DDL, sample data and expected results to help with out further information

We can work on the emails later

Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2012-07-04 : 02:30:26
the sample of data should be as below:

email name group domain caseNo caseDescription
jane@a.aa jane groupA a-Jane 12345 notes1
jane@a.aa jane groupA a-Jane 22345 notes2
jane@a.aa jane groupA a-Jane 32345 notes3
john@a.aa john groupA a-John 33455 notes4
john@a.aa john groupA a-John 44455 notes5
.
.
.
.
.

expected result is to send every each case tie to their own domain to their email address.

example: send Jane cases to her email which has 3 case tie to her domain.

email name group domain caseNo caseDescription
jane@a.aa jane groupA a-Jane 12345 notes1
jane@a.aa jane groupA a-Jane 22345 notes2
jane@a.aa jane groupA a-Jane 32345 notes3
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-07-04 : 03:44:58
what do we do about John?

How do we know we want Jane?
Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2012-07-04 : 03:55:37
i need to send all to the recipents..but they will only get their own cases.
Go to Top of Page
   

- Advertisement -