Solved

asp.net sql

Posted on 2014-10-07
5
126 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 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

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…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

717 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