Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201

    Unanswered: Getting data off SQL server to CSV

    I have a SQL string that returns a record set through Query Anal.

    I need to return that recordset to a CSV file then EMAIL that.

    I was going to use DTS as that is the company Standard to MOVE data.

    This didn't work as the SQL uses a #temptable and couldn't map using the GUI DTS.

    I used save as to a BAS file from gui and then changed the SQL within the BAS file.

    This is a valid solution However is presented with the same problem is there a different/better way to skin this cat.

    FYI cannot create a table to replace temptable without 400000 signoffs. Can do it but don't care to tackle at this time.

  2. #2
    Join Date
    Jul 2005
    Location
    New Zealand
    Posts
    61
    I have a similar requirement to email a resultset once a month. What I did was create a Job with three steps:
    1. Run the query and save the results to a file
    2. Email the file using xp_sendmail
    3. Email myself a reminder to update the query - again, using xp_sendmail

    I then scheduled the job to run on the last day of every month.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •