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.
| Author |
Topic |
|
kenlok
Starting Member
16 Posts |
Posted - 2009-11-05 : 06:46:20
|
| Dear Sir, I would like to use SQL Mail to mail below table with mail.How can I do it in function?ThanksSQL Mail ------------------------------------EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Alert', @recipients = Email, @body = 'Use new feature of Database mail. No MAPI client needed', @subject = 'New Feature of Database Mail'Table 1------------------------------------Order_No StyleNo Subject SalesTeamId FrValue ToValue PointId CreateDateTime20001B TEST Color 12 (90) (100)20001B TEST Quantity 12 145 15520002B TEST Quantity 13 147 159Table 2------------------------------------SalesTeamId Email12 test@test.com; test2@test.com13 testA@test2.com; testB@test2.comAnd the Result Are 2 Mail :--------------------------------(Mail 1)EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Alert', @recipients = 'test@test.com; test2@test.com', @body = '20001B TEST Color 12 (90) (100)20001B TEST Quantity 12 145 155', @subject = 'Mail 1'(Mail 2)EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Alert', @recipients = 'testA@test2.com; testB@test2.com', @body = '20002B TEST Quantity 13 147 159', @subject = 'Mail 2' |
|
|
haroon2k9
Constraint Violating Yak Guru
328 Posts |
|
|
kenlok
Starting Member
16 Posts |
Posted - 2009-11-05 : 20:23:33
|
| How can I write a query about "select" with the mail function? |
 |
|
|
|
|
|