February 15, 2013 at 2:18 pm
This is not a pure database job, it might also involve works from front-end but I am hoping to get some idea from here. Thanks.
In my project, I need the function of user clicking on a button then a stored procedure will be invoked to do some datamining and have the data be sent to user via email.
This is not a auto job, I need this be done in a ad doc manner.
Is it possible? I know there is no problem sending data as attachment in scheduled job.
Thanks.
February 15, 2013 at 3:51 pm
How large of an attachment are we talking? msdb.dbo.sp_send_dbmail can send query results as a csv attachment but there are limits on the size of the attachment it will send by default that you may need to increase if you go that route. Also consider the SMTP relay may have size limits too, or the user mailbox itself on receiving the email. msdb could bloat with lots of emailing flowing too. I could see you needing to defend against impatient users spawning the same resource-intense email request multiple times as well, but other than those things I mentioned msdb.dbo.sp_send_dbmail might do what you need mostly out of the box.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
February 15, 2013 at 3:57 pm
halifaxdal (2/15/2013)
This is not a pure database job, it might also involve works from front-end but I am hoping to get some idea from here. Thanks.In my project, I need the function of user clicking on a button then a stored procedure will be invoked to do some datamining and have the data be sent to user via email.
This is not a auto job, I need this be done in a ad doc manner.
Is it possible? I know there is no problem sending data as attachment in scheduled job.
Thanks.
Do you know how to create a stored procedure that will create the CSV format?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 15, 2013 at 7:34 pm
I know how to create the csv and send it as attachment using the sp mentioned above, I am just worrying if there might be any privilege restriction
February 15, 2013 at 8:22 pm
Yeah ur right you need a front end, i already encounter what you need to do and me i used vb.net. The flow of my application is this , after calling the stored procedure i put the data into data set and insert the data to excel that saved in my local drive and then i call a fuction in my application using smtp to send the files to email.
February 15, 2013 at 8:24 pm
Books Online details the required permissions and if you have any doubts I am sure it is nothing running a few tests can't answer for you.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
February 16, 2013 at 7:52 am
math martinez (2/15/2013)
Yeah ur right you need a front end, i already encounter what you need to do and me i used vb.net. The flow of my application is this , after calling the stored procedure i put the data into data set and insert the data to excel that saved in my local drive and then i call a fuction in my application using smtp to send the files to email.
I think this is the right approach and I might not even need the email function since I can create the excel and let user to choose download
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply