How to send three attachments using three queries in a single email using sp_senddbmail

Hi All,
I have three scripts for extracting permissions at server,database & object level.Now how do i can execute all three queries and send multiple attachments in a single email using sp_senddbmail.I have done this before for single queries but not multiple
queries. Kindly suggest.
Regards
Rahul

Hi All,
The requirement was that i had three different queries for listing permissions at server,database and object level.I wanted to build an solution to email results in attachment to user.
However i have managed to do this with SSIS Package.I was curious to know if it can be done without SSIS.
Thanks you all for your time and effort for this.
Rahul
It can be done without SSIS
Just have a procedure to return  three query results as a single resultset. Then use sp_send_dbmail to execute query and send results as a email
See
http://blogs.msdn.com/b/sqlagent/archive/2010/11/03/sql-database-mail-send-t-sql-results-by-email.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve things under an old Apple ID when the email used for that account no longer exists? I am trying to update a number of apps that was bought under an

    I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve apps under an old Apple ID when the email used for that account no longer exists & I can't remember the password? After speaking with Apple Acct. Security, I got the security Q right but my birthday was wrong! They wanted the serial number from my phone that was 3 iPhones ago! Seriously??!!
    Any updated way to work around this? No Apple people can correct it.
    Thanks,
    Joe

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • How to send mail attachments using java mail

    can any one help how to create mails attachments using java mail

    you can do it like this:
    Message msg = new MimeMessage(session);
    String fileAttachment = "c:/test.txt";
    Multipart mp = new MimeMultipart();
    BodyPart bp = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(fileAttachment);
    bp.setDataHandler(new DataHandler(fds));
    bp.setFileName(fds.getName());
    mp.addBodyPart(bp);
    msg.setContent(mp);
    ...

  • How to send multiple attachments thru mail?

    I haven't been able to figure out how from the mail application send docs, worksheets etc as attachment. Also how to attach multiple docs in the mail. Looking for help on this.
    Sparashar

    You need to start in the app that contains the files that you want to send as attachments and use that app's functionality to select and attach files to an email, and not start in the Mail app e.g. the GoodReader app supports multiple document types (word and excel, read only, PDFs, text files, pictures) and allows you to select one or more of them and attach/switch with them to an email.
    In the Mail app itself on iOS 6 you can now press and hold the body of the email and select photos from the Photos app to attach to it.

  • How to send multiple files with it's original name over HTTPS using one CC?

    I am working on a File to HTTPs scenario. It is in production and working fine. Currently we send only one file and I have hard coded the name in the communication channel in the header fields. Now we have to send more files with different names and I want to use only one receiver channel instead of many. We need to send the files with their original names.
    I used the ASMA in the sender File Adapter and I see the FileName in the dynamic configuration under http://sap.com/xi/XI/System/File name="FileName".
    I know we can use a UDF in message mapping and get the value and put it in HEADERFIELDONE. But we don't want to use mapping as the files are huge and we don't want to insert XML tags in the payload.
    So how do I put the Filename from the DynamicConfiguration to the HTTP header field as FileName without using mapping? Are there any settings?
    Can I put something in the PROLOG or can I use any other module in the File Sender Adapter or is there any other option?
    Any help is appreciated.
    Thanks
    Sai

    See my blog:
    /people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
    You have to put the configuration in sender channel, as HTTP adapter does not allow modules.
    For the second module, put values related to HTTP adapter.

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • How to send multiple attachments?

    Sorry if this seems like an obvious question but can it be done? Do I need an extra app or helper?
    Thanks in advance

    Ernie,
    I have had problems with sending some attachments to windows users.
    i cant tell exactly what is causing it.
    usually i am making .pages documents which i then export as PDFs.
    many times windows users email me back that they cant even see the attached PDFs (not not open them, but cant even see them).
    there seems to be some sort of bug. (yes, attach as windows friendly documents is selected).
    some have suggested that attaching multiple attachments using the command click method might be at fault.
    others have suggested that exporting to pdf might be a problem and the resulting pdf not always readable by windows users.
    can you give any suggestion that might ensure windows users can always open my attached PDFs?
    thanks

  • How to send internl tab val 4m 1 prog to other without using IMPORT EXPORT

    Hi All,
    I need to send the vales of internal table from one program to other program without using IMPORT and EXPORT parameter.
    Actually i have implemented one enhancement in standared program and need to send the internal table records to one Z-Program not using memory id import and export.
    How can i do that ?
    Thanks in Advance.
    Regards,
    Umesh

    Hi Umesh,
    you might create a function group with a global internal table. Then you call one FM in standard report to fill global data and a second call of a FM can access the global data - as long as this is still running in the same process (transaction).
    "Sending to an other program" is quite general, if your own program is not part of the first process, you might need to save values in a z-table and plan your report periodically checking for new data.
    BR, Christian

  • How to send only one (of several) attachment from a receiver email adapter?

    Hi all,
    I have been working with the SAP XI email adapter for some time and now I encountered the following challenge:
    I am receiving a message via email from a partner, call some modules which lead to the generation of 5 attachments in total for the incoming message.
    I then map the MainDocument to a CONTRL message and return it to the sender using the dynamic parameters of both the sender and the receiver email cc.
    I am filling these parameters inside the message mapping; so far I am not using the mailpackage xsd (the only things out of the ordinary are checked boxes for "use adapter specific parameters", "variable transport" and "keep attachments").
    My problem is that the email receiver cc now generates an email with 5 attachments when I need it to add only the CONTRL (aka MainDocument) as attachment to this email.
    Do you know if there is a way to tell the receiver cc to only use one attachment (or to remove attachments from the original message, f.ex. inside the message mapping)?
    Thanks and cheers!
    Stefan

    Hi Stefan,
    >>>>Do you know if there is a way to tell the receiver cc to only use one attachment (or to remove attachments from the original message, f.ex. inside the message mapping)?
    1. It cannot be done in a mapping
    2. have a look at mz blog
    how simple it is to write an adapter that will do what you need
    (just check the delete part of this blog):
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • How to create a file which i can attach to an email using the same print routine i use for printing

    Hi all,
    In my current code i print a document.
    What I would like to do is attach this file - possibly as a pdf - to an email using the same print routine ( with some additional code obviously)
    Did some research on the web and can't find a solution to this.
    Any help would be appreciated.
    Regards
    Jan Konijnenberg

    What I would like to do is attach this file - possibly as a pdf - to an email using the same print routine ( with some additional code obviously)
    You need to install a printer that 'prints' to a PDF file.  Then send your document to that printer and attach the file.  There are several available, free and commercial.
    http://www.dopdf.com/
    There are other formats which may be suitable.
    http://www.howtogeek.com/150891/how-to-print-to-pdf-in-windows-4-tips-and-tricks/

  • I used to be able to send document as a PDF or Word Document via email using the toolbar.

    I used to be able to send Pages documents as a PDF or Word Document via email using the Pages toolbar (not the iWork feature).  Lately, it hasn't been working at all.  No email pops up; just nothing.  Is anyone else having this problem?  Any solutions?  I'm running Pages '09 version 4.1.

    This Apple Express Helper is a dumb one.
    File names with # and $ are perfectly treated by the share to Mail feature.
    What is rejected is the slash (/) and it's perfectly normal.
    Since the delivery of the first version of OS X, slash is an illegal character in file names.
    Apple thought that it would be fair to build a piece of code taking care of such chars because they were valid ones in the older operating systems.
    But they expected that users will drop these chars. Alas they didn't and users like you are continuing to play with matches.
    At last, OS X 10.7 removed the extraneous code and now, hosanna, iWork refuse to export files whose name contain the infamous slash.
    Yvan KOENIG (VALLAURIS, France) lundi 9 avril 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How to send 100 records from an IDOC to File Scenario without using BPM?

    Hi All,
    I have a requirement that i need to send 100 records from sap to file by using the scenario IDOC to File. Can you suggest how can i achieve this?
    Regards,
    Ramvilas.

    Hi,
       Create a H type RFC destination.Tagert host and port give  Xi system host and port.Path give the
       /sap/xi/adapter_plain?namespace=<NameSpcae>&interface=<Interface> &service=<SenderBusinessSystem>&qos=EO or EOIO.
    Go to we21 find xmlhttp port.give the port name and assign RFC.Give the port in we20 your idoc and change to collective.
    In Xi export the IDOC and change the occurance to 0-unbounded and import it.
    Regards,
    Prakasu.M

  • How to send multiple attachments at runtime?

    Please help

    The JavaMail FAQ talks about sending attachments and the
    demo programs that come with JavaMail illustrate how to do it.
    Sending more than one attachment is an obvious generalization
    of the examples.
    What part are you confused about?

  • How to send multiple attachments when the number of attachment is known at

    I am creating an independent E-mail component for an n tire architecture. This component gets the email message and files_to_Attach as method parameters.
    Files to attach is inside an array list.
    So the number of files for attachment is known only at run time.
    How can I attach this files.
    If I use single instance of MimeBodyPart (ib side a Four or While loop), it attaches the last file several times.
    Please advise me on this

    hi
    some related links
    http://forum.java.sun.com/thread.jspa?threadID=684327&messageID=4429819
    http://www.jscape.com/articles/sending_email_attachments_using_java.html
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=45&t=003546
    http://www.dbforums.com/showthread.php?t=1059049
    http://www.experts-exchange.com/Programming/Programming_Platforms/Unix_Programming/Q_21072849.html

  • How to send multiple attachments with the mail in jsp

    hi.I wrote a code to send mail.but i need to send mail with multiple attachments.when i run this code iam able to send message but not files.i want to send files as attachments with the message.please help me.
    <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
    <%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
    <%
         String Attachfiles1="";
         String Attachfiles2="";
    String Attachfiles3="";
    if("Send".equalsIgnoreCase("send"))
    try
    String subject="",from="",url = null,to="";
    String mailhost = "localhost";
    Properties props = System.getProperties();
    String msg_txt="";
    String strStatus="";
    String mailer = "MyMailerProgram";
    to=request.getParameter("to");
    from=request.getParameter("from");
    subject=request.getParameter("subject");
    msg_txt=request.getParameter("message");
    props.put("mail.smtp.host", mailhost);
    Session mailsession = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(mailsession);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
    message.setSubject(subject);
    message.setHeader("X-Mailer", mailer);
    message.setSentDate(new Date());
    message.setText(msg_txt);
    BodyPart messageBodyPart = new MimeBodyPart();
    BodyPart messageBodyPart2 = new MimeBodyPart();
    Multipart multipart = new MimeMultipart(); // to add many part to your messge
    messageBodyPart = new MimeBodyPart();
    javax.activation.DataSource source = new javax.activation.FileDataSource("path of the file");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("file_name");
    messageBodyPart2.setText("message"); // set the txt message
    multipart.addBodyPart(messageBodyPart);
    multipart.addBodyPart(messageBodyPart2);
    Transport.send(message);
    out.println("Message Sent");
    catch (Exception e)
    e.printStackTrace();
    if("Attachfiles".equalsIgnoreCase("attachfiles"))
    Attachfiles1=request.getParameter("fieldname1");
    Attachfiles2=request.getParameter("fieldname2");
    Attachfiles3=request.getParameter("fieldname3");
    %>
    <html>
    <body>
    <div class="frame">
    <form action="Composemail.jsp" method="post">
    <b>SelectPosition:</b> <select name="cars" >
    <option value="ABAP">ABAP
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select><br><br>
    <table border="1" cellpadding="2" cellspacing="2">
    <tr><th>Name</th>
    <th>EmailId</th>
    <th>ContactNumber</th>
    <th>Position</th>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </table><br>
    <b>SelectUser :</b><select name="cars">
    <option value="Administrator">Administrator
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select>
    <br>
    <b>To :</b>�����������<input type="text" name="to" size="72"><br>
    <b>From :</b>�������<input type="text" name="from" size="72"><br>
    <b>Subject :</b>���<input type="text" name="subject" size="72"><br>
    <%=Attachfiles1%><br><%=Attachfiles2%><br><%=Attachfiles3%><br><br>
    <b>Message:</b><br>
    ������������<textarea rows="10" cols="50" name="message">
    </textarea> <br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname1" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname2" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>�<input type="file" name="fieldname3" value="filename" size="50"><br><br>
    ������������<input type="submit" name="attachfiles" value="Attachfiles">
    <center>
    <input type="submit" name="send" value="Send" >
    </center>
    </form>
    </div>
    </body>
    </html>

    Most likely you're not specifying the path of a file on the server machine.

Maybe you are looking for

  • How to connect my printer and ipad

    i have an ipad 2 that used to connect to my printer but once i moved it no longer connects. i have a hp photosmart plus printer... help

  • Out of control prices

    I would just like to say that the plan pricing is out of control. There are a lot of services out their and you are to high. You reward new customers with new phones and trap the dedicated customers with the offer of FREE over priced phones and 2yr c

  • Cash sales billing i

    Hi, I raised the cash sale and it given the Doc no also but when i gone for billing in processing status it is telling Not processed How can i do the billing for this ? same msg is also coming for rush order

  • New python call teststand engine

    I re-write my issue in new message.Thanks very much for altenbach's remindding. I use python and teststand engine to customize solution.But I have some questions about it. 1,code as below: tsEngine = win32com.client.Dispatch("TestStand.Engine.1") pri

  • OM Number Ranges Problems please help

    Hello Gurus! My client wants 2 things in OM: 1) 9 Digit Org Unit Code 2) Mixture of Alphabets and Numbers for Unit code. Can anyone suggest which one is possible and if both are possible? Thanks, Soniya