| Author |
Topic |
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 14:16:33
|
| Hi all,How can i create this event.IO have user and their status!for example.select id,user,status from usertbaleuse user from usertable and then send email with the id.Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-15 : 14:51:04
|
| I don't understand. Could you provide a data example?Tara Kizeraka tduggan |
 |
|
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 15:05:00
|
| Thhere is no data.the situation is :Get the data from proj table (status, and id)and then get user info and then send email with list of ID thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-15 : 15:11:26
|
| Even if you don't currently have data in your system, please make some up so that we can better understand your problem. What e-mail system are you using?Tara Kizeraka tduggan |
 |
|
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 15:35:05
|
| in proj tableid status username4302 2 test5582 6 test15871 3 test32258 4 test4user tableid username email 2258 test4 test4@test.com5871 test3 test3@test.com5582 test14302 test |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-15 : 15:37:50
|
| So now that we have some sample data, what should we do with it? What e-mail system are you using? CDO, SQL Mail, ...?Tara Kizeraka tduggan |
 |
|
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 15:56:58
|
| CDO |
 |
|
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 16:06:42
|
| get the id and email it to users such as send id[s] 4258,5871 to test user!! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-15 : 16:14:20
|
| Your subject says cursor. Are you asking how to avoid a cursor or how to use one? If you want to e-mail to multiple userids, then you'll have to loop, whether it be a cursor or a WHILE loop is up to you.Tara Kizeraka tduggan |
 |
|
|
PatDeV
Posting Yak Master
197 Posts |
Posted - 2006-02-15 : 16:46:11
|
| so please how can i create cursor for that!! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-15 : 16:50:23
|
Here's a simple example:DECLARE @c1 int, @c2 varchar(50)DECLARE YourCursor CURSOR FOR SELECT Column1, Column2FROM YourTableOPEN authors_cursorFETCH NEXT FROM YourCursor INTO @c1, @c2WHILE @@FETCH_STATUS = 0BEGIN EXEC YourEmailStoredProcedure @c1, @c2ENDCLOSE titles_cursorDEALLOCATE titles_cursor Tara Kizeraka tduggan |
 |
|
|
|