Solved

asp.net sql

Posted on 2014-10-07
5
123 Views
Last Modified: 2014-10-10
Assume I have a query like select firstname, email from person. and the list I want to wrap into html and email to someone else. And I want to send it at 11:00 pm daily. In the condition, what is the best method I can use?

My database is SQL Server 2012 and I do have IIS.

I know asp.net/c# languages, and of course I can write Stored Procedures.
0
Comment
Question by:ITsolutionWizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40367393
Huh?   Please provide more details as to what you are asking here.

>Assume I have a query like select firstname, email from person.
Okay, either use a SQL Server view or a stored procedure.

>the list I want to wrap into html and email to someone else.
Not sure about ASP.NET.  Do you mean send an email where the body is the html, or send an email with an attached file that has the html?

>And I want to send it at 11:00 pm daily
Either an SSIS package to output the file, and a SQL Agent job to schedule it.
A better idea would be an SSRS report with a data-driven subscription.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 40367442
Not sure about ASP.NET.  Do you mean send an email where the body is the html, or send an email with an attached file that has the html?  Yes.
0
 
LVL 41

Accepted Solution

by:
Sharath earned 500 total points
ID: 40367505
You can create a SP which can generate the html body and send an email with that html body.
Create a SQL agent job to run the sproc at specific time.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 40367559
Got it. But the Email (TO) is based on the result from the query. For example, I may want to send 4 contacts emails from the query1 or 3 contacts from query2.

How can I do it in SQL Agent?
0
 
LVL 41

Expert Comment

by:Sharath
ID: 40372435
Are you still looking for a suggestion?
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question