What is the best way to send auto mail with excel(generated by query) attachment?

Hello,
Need to generate first data from stored procedure and the save it to an excel file and then send mail with the same excel file.
So am searching for the best way so that i could do all process in a single task with daily or monthly schedule.
As per my understanding, we could it via SSIS and by sql server using
sp_send_dbmail.
But i have to generate excel file first by stored procedure and then end it by mail.
So please suggest the best way to accomplish all task in a single task.
Thanks
Ajay 

Hi Ajay,
As shown in the blog mentioned by Syed, to delete records from the Excel file, you need to use Update OpenRowset command to update the corresponding rows to blank.
Alternatively, you can also use Derived Column Transformation or Conditional Split Transformation after the OLE DB Source so that you can replace the target rows with NULL before exporting to Excel destination or just redirect the expected records to the
Excel destination.
Then, in the Control Flow, you can add a Send Mail Task to send the Excel file by setting it as the attachment. The following screenshot is for your reference:
Regards,
Mike Yin
TechNet Community Support

Similar Messages

  • What is the best way to sandbox Yahoo Mail with Firefox?

    I want to create a icon on a users desktop that launchs yahoo mail in it's own instance. (User profile I guess)
    Here's the background:
    I volunteer with a local seniors citizens organization to provide free computer support to seniors on a limited budget. Many seniors use yahoo becuase it was what they learned to use way back when and don't want to change. It is widely known that yahoo accounts have been subject to a recent spree of hacking using exploits, some of which do not even require a user to click on a link. I have seen firsthand 5 incidents where separate individuals using separate computers have had yahoo accounts hacked.
    One of my clients was an ATT customer, thus entitled to phone support. In a recent conversation with ATT support who uses yahoo for their e-mail services, they told me they are aware of the problem and the best solution is to logout of your yahoo account every time you are done using it. This is problematic for Senior Citizens who can't or won't remember passwords, they want it to just work.
    I began thinking that there must be a way to protect a user from at least some of these exploits.
    My finial idea is to create a desktop icon that will launch an instance of Firefox that is separate from the other websites that a user may be browsing. I think this could be accomplished using user profiles and some command line options.
    Any other ideas?
    Extensions? I'm thinking of blocking flash and java on that instance too.

    hello, first of all please make sure that firefox is up to date (version 20.0.1 at the moment) and that all plugins are updated to the latest version on the systems in question in order to fix known vulnerabilities...
    [[Update Firefox to the latest version]]
    https://www.mozilla.org/plugincheck/
    you are right, you can use the [[Use the Profile Manager to create and remove Firefox profiles|profile manager]] in order to create a dedicated profile and then create a desktop shortcut for it. here are the command-line arguments for firefox.exe that will help you accomplish that: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options
    deactivating java and other plugins that are not necessary for emailing is certainly a good idea too. you could also use an extension like adblock plus together with a filterlist that blocks known malware domains: http://adblockplus.org/en/features

  • What's the best way to send multiple objects with a message?

    I'm considering using an ObjectMessage and storing a Map as the object. Each
              of the objects I need to send will be bound in this Map. Is this the correct
              approach?
              Also, if this is the correct approach, where should I store the constants
              for the Map keys? If I put them in the MDB consumer, it ties the client to
              the consumer and vicea versa. I guess I could declare them in my main
              interface.
              Thanks,
              Bob
              

    OK.
              But for what it's forth, if you were to need to put a Map in an
              ObjectMessage, you might find that MapMessage gives you similiar (if not
              better) functionality, the resulting message will be smaller, and your
              system may perform better. The various implementations of java.util.Map are
              pretty hefty objects to serialize, whereas a MapMessage (at least, the
              MapMessage from BEA JMS) has been optimized to be pretty compact and fast.
              On the other hand, the only kinds of objects you can put in a MapMessage are
              Java primitive types (int, String, and so forth), whereas in a java.util.Map
              you can put any kind of object.
              greg
              "Bob Lee" <[email protected]> wrote in message
              news:[email protected]...
              > Nevermind. I'm using a Command pattern.
              >
              > Bob
              >
              > "Bob Lee" <[email protected]> wrote in message
              > news:[email protected]...
              > > I'm considering using an ObjectMessage and storing a Map as the object.
              > Each
              > > of the objects I need to send will be bound in this Map. Is this the
              > correct
              > > approach?
              > >
              > > Also, if this is the correct approach, where should I store the
              constants
              > > for the Map keys? If I put them in the MDB consumer, it ties the client
              to
              > > the consumer and vicea versa. I guess I could declare them in my main
              > > interface.
              > >
              > > Thanks,
              > > Bob
              > >
              > >
              >
              >
              

  • What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera?

    What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera? It says the utility disk is a PowerPC app and that is no longer supported. What do I do now? I can't upload photos from my camera.

    Also, I had the same problem happen when I tried to install an older version of Corel Painter. Are Macbook Pro users just NOT supposed to be able to use their laptops for the purposes they are best designed for?
    -Frustrated new Mac user

  • What is the best way to run dual monitors with a 2011 MBP?

    I have a 2011 MBP and i want to run dual 1920x1080 monitors. what is the best way to accomplish this? i also have a PC attached to the monitors with the DVI connection (but would be willing to change this to the analog, if necessary). so i have teh analog and HDMI connections available on the backs of the monitors.
    what i would like to do is hook the MBP through the HDMI if possible and then i would just be able to change inputs on the monitors depending in which computer i want to use (PC or MBP).
    any ideas would be greatly appreciated. thanks.

    csb814 wrote:
    I have a MacBookPro 17" 1.5 GHz running OS 10.5.7 with 1.5 GB Ram and would like to load Windows XP SSP2 so I can run several specific windows programs that are not Mac supported without a dualcore system.
    Ok, you either own a MacBook Pro with an Intel Processor, or a PowerBook with a PowerPC Processor.
    If your stated speed is correct, then you own a PowerBook, which will not run Windows natively. development & sales for Virtual PC has ceased. The only emulator still around, I think, is iEmulator & is terribly slow on G4s.
    Boot Camp does not work on PowerPC Macs.
    Please correct your signature & descriptions so we can identify the correct machine. Thanks!

  • What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    What is the best way for sharing an iPad with 2 iPhones using different Apple acount ?

    You can't share with other devices if you are using different Apple ID's and iTunes account on them. You can only share if you use the same ID.

  • What is the best way to send a file?

    i am writing a program and i want to transfer a file from a client class to a server class... what is the best way to do that?
    convert the file to bytes using the following
    File file=new File("jobs.xml");
               byte buffer[]=new byte[(int)file.length()];
               try {
                    BufferedInputStream input=new BufferedInputStream(new FileInputStream("jobs.xml"));
                    input.read(buffer,0,buffer.length);
                    input.close();
               } catch(Exception e) {//DIORTHOSE TA MSGS
                  System.out.println("reading jobs.xml->buffer: "+e.getMessage());
                  e.printStackTrace();
               firstServerRef.translationService(theCallbackObjectRef, buffer);for a reason i dont like that i am reading the file again to put it in the buffer and send the buffer... are my worries reasonable or not? is there any other better way to do that?

    Use a smaller buffer, repeatedly read and
    write, and print the exception's stack trace.
    What do you mean by reading again, by the way? I only
    see you reading the file once.hmm you mean use a smaller buffer and call the function with the smaller buffer many times in a while?
    the client and the server are not on a single machine and i want to call the function only once... could you clarify the thing that you said..
    yes you are correct that you see only one reading because i haven't pasted the rest of the code which is sth like...
    FileWriter fw = new FileWriter("jobs.xml");
               ObjectOutputStream out = xstream.createObjectOutputStream(fw);
         //      out.writeObject(new Jobb("ougk2", "Walnes",null));
              for(int i=0;i<nameOfServices.length;i++){
                   Jobb translationJob=new Jobb();
                   //find the service !
                 NameComponent nc = new NameComponent(nameOfServices, " ");
    // Resolve the object reference in naming
    NameComponent path[] = {nc};
    //create a ref for the servant of the service
    ServiceOperations theRemoteObjRef = ServiceHelper.narrow(ncRef.resolve(path));
    // JobOperations theRemoteObjRef = JobHelper.narrow(ncRef.resolve(path));
    translationJob.setObjServerRef(theRemoteObjRef.toString());
    if(i==0){ //this is the first job
         translationJob.setForTranslation(wordForTranslation);
         firstServerRef=theRemoteObjRef;
         out.writeObject(translationJob);
         out.close();
         File file=new File("jobs.xml");
              byte buffer[]=new byte[(int)file.length()];
              try {
                   BufferedInputStream input=new BufferedInputStream(new FileInputStream("jobs.xml"));
                   input.read(buffer,0,buffer.length);
                   input.close();
              } catch(Exception e) {//DIORTHOSE TA MSGS
         System.out.println("reading jobs.xml->buffer: "+e.getMessage());
         e.printStackTrace();
              firstServerRef.translationService(theCallbackObjectRef, buffer);
    which i believe is bad....

  • What is the best way to send multiple pdf files to my ipad

    what is the best way or app to send multiple pdf files to my ipad, so that I can then combine them into one folder

    I have the app Readdle Docs. It allows you to move PDF files to your device and to move them around on your device. Might check it out. ( I think there's an iPad version of the app, but I have the iPhone version and it works, just not as pretty)
    THere's also Goodreader, but I don't have experience with it to know if it has folder abilities.

  • What is the best  way to send one email for 2000+ address?

    Hi I want to send oneemail msg (only text) from mor than 2000 address.
    I want that the recp. will not c the other address (i. e. each address should be a BCC)
    what is the best way to do it? sned 2000 emails or to send 20 emails with 1000 recp. ?
    is there any limitation on the number of recp in BCC?
    10x alot Yonatan

    is there any limitation on the number of recp in BCC?
    mail server you are using may be the limiting factor. However, most mail server handle 2000 recp. You will get smtp error 552 if the mail server cant handle 2000 recipients.

  • What's the best way to send photos to a PC user?

    I'm new to the Mac world and need to know the best way to send photos to a PC user.

    Most if not all email have "Attachments" listed in the email menu.  Just click on it & follow the onscreen instructions.  Very simple. 

  • What is the best way to manage photos - Dropbox (with sync), Facebook (with sync), iPhoto, etc.?

    With so many cloud based and wireless syncing services, I'm lost as to the simplest way to keep photos sync'd as well as backed up. My dropbox is currently syncing all photos I take with my iphone, but in an overall folder called CAMERA UPLOADS, so they are uncategorized. I upload pics to facebook, which facebook also has a sync photos feature, but I don't necessarily want all photos uploaded to facebook. What has worked best for everyone so that there aren't a ton of dupicate photos everywhere, and multiple syncs of the same photos?
    Also, what is the best way to manage my iPhone photos generally? I'm never sure if I delete a photo from my phone, does it delete it on my computer via iCloud? Sometimes I just take a picture to send to a friend that I don't need to keep, while others are ones I want to sync to my computer. Can I control when deleting that it be deleted everywhere or just on the device? And alternately, can I choose certain photos not to sync via iCloud?
    iCloud makes me nervous. Once when I wanted to place all photos of my pup into a folder, I selected the photos on my iPhone and accidentally clicked delete instead of move. No big deal, I figured they'd be at home sync'd on the cloud. But since I'd deleted them on my phone, the cloud deleted them on my home computer too and the photos were lost.

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

  • What is the best way to lay out color-coded Excel data in InDesign?

    I’ve been away from layout for some time. I now need to lay out color-coded Excel data (3 columns, 200 rows) in InDesign 5.5. The data will need to be in alpha order and each row will be color coded, with a color key at the top of the page. What is the best way to lay this out? Should I use the table tool and create a new style for each color that I need to use?
    Thanks for your help.

    I think this will work in CS3.
    Start off by inserting Styles of WEEK, Mon to Friday (as per left)
    Set the Week No. to Bullets and Numbering and insert as per screen shot
    Do the same for Days Monday through to Sunday
    Also set up Monday style NEXT STYLE to be Tuesday
    When you get to Sunday - loop the Styles back to WEEK style.
    Then as per first screen shot you just have to insert RETURNS all the way down to initiate the style.

  • What is the best way to manage photo's with multiple login accounts?

    There are three people in my household and each has their own login into the computer. I also have and external drive.  Space is becoming short on the computer, so I want to move all my photos and music to the external drive.  I have moved all the music files and folders to the external drive and then each user has just updated their individual iTunes folders, pointing to the external drive.
    However, what is the best way to manage photo's? Do I do this same process or is there another way? I don't want any music or photo files on the computer's hard drive at all if it can be avoided.

    I am presuming that we cannot share downloaded apps and music between accounts because of the copyright issue,
    Though I'm no copyright lawyer, as long as it's within a household, you can share content among users. Such sharing is, absent specific language preventing it not present in the iTunes Store terms of use, generally considered to be "personal use". So you can share apps and music amongst your users on your computer and with their devices. You just can't give any of that content to friends or relatives who don't live with you.
    What I am not clear on, it making sure that this appears in each itunes account - is it easy to find the file storage folders that match the itunes accounts and what would these be?
    The iTunes library and files are by default in a user's Home/Music folder. But you don't have to find the folder; in fact putting a file into the folder yourself won't add the file to iTunes. Just drag the file into the iTunes window. iTunes will copy it to the correct location.
    Regards.

  • What's the best way to update my Mac with the latest version of Adobe Flash Player?

    I've been getting prompts whenever I look at certain websites to download the latest version of Adobe Flash Player.  I'm skeptical as to responding to those prompts.  What is the best way to update my Mac Pro with the latest version of Adobe Flash Player?

    You might also want to consider uninstalling Adobe Flash... I currently don't have it installed and haven't needed to install it.  Most websites are now coded in HTML 5 so that the iOS devices can actually visit them.  I can still watch YouTube videos et al.  About the only thing I can't do is play Flash games... but they're a resource hog anyways. 
    Try going without for a day or two and see just how many sites you visit no longer require it.  A lot of people keep it installed out of habit, not out of necessity.  If you have Flash installed, visit a site and it's out of date, it will tell you to update your Flash.  What it won't do is tell you is that had Flash not been installed, it would have used the HTML 5 code instead.  Think about it... if an iOS device can't run Flash at all... it can't visit this site if it were written only to use Flash.  What site would eliminate such a huge portion of their market base?  You'd be surprised at how many sites use HTML 5.  Uninstall Flash and see for yourself.

  • [Solved] What's the best way for me to help with Arch?

    I've been using Linux for about 10 years and Arch for a little over a year.  I used to do a lot of distro-hopping but I've found that since finding Arch, I haven't been doing much of that.  I don't know why it took me so long to find it.
    Anyway, I'd like to give back a little so what's the best way for me to help?  I'm not a programmer so I'd be no help there.  I have made a couple contributions to the wiki and filed a bug.  I know that kind of stuff is easy and obvious.  Is there anything else I could be doing?
    Last edited by brianhanna (2010-04-07 02:25:34)

    I hear the Arch Linux Magazine could always use some contributions, if you're inclined towards that sort of thing. I've been wanting to write an article for a while, but I've not run into anything in my Arch experience so far that's really inspired an article out of me.

Maybe you are looking for

  • Error in using External Process in the Process Flow

    I Created a Process Flow with an external process to Move the file from one location to another location, I gave the below parameters for the External Process COMMAND: move PARAMETER_LIST: ?F:\\FlatFiles\\in\\company.txt?F:\\FlatFiles\\error\\company

  • Copy-and-paste into Snow Leopard's Mail from Parallels 5.0 doesn't work

    After upgrading Leopard to Snow Leopard, my Parallels 3.0 application no longer worked. Since I had an invitation to beta test Parallels 5.0, I took advantage of that opportunity. Since then, there has been a problem "copy-and-pasting" from an Intern

  • Stuck Pixels + Dust

    I have had my iPod for 4 months now and have had 2 stuck pixels since i got it, they have only just started annoing me as i have now started watching movies. Added to this i have quite a large amount of dust behind the screen mainly in the top left c

  • Validation Error: VLD-1111

    I'm trying to Validate a mapping between a source and staging table and recieve the following error message: "VLD-1111: The mapping cannot be generate due to operators requiring different code languages." My source table is in an Oracle 9i DB and so

  • Reg:customizing of IW38

    Hi , i have copied the program of IW38 RIAUFK20 to ZRIAUFK20 after executing ZRIAUFK20 in the selction screen dropdown for all selections is missing . the output screens of RIAUFK20 and ZRIAUFK20 is loking smilar  but while executing through T-code i