?
Solved

asp.net sql

Posted on 2014-10-07
5
Medium Priority
?
128 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 66

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 2000 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Suggested Courses

752 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