Solved

MSSQL 2000 - Convert table to csv and send as email attachment

Posted on 2007-11-21
4
991 Views
Last Modified: 2009-12-16
Hi All,

how can i add a schedule job in MSSQL 2000, so that it can automatically convert a table into csv, and send csv file as an email attachment every week?

thanks a lot!
0
Comment
Question by:orbulat
  • 2
4 Comments
 
LVL 11

Assisted Solution

by:Otana
Otana earned 200 total points
ID: 20333123
- Create a DTS package, in which you export your table to a csv file (with a data transform task).
- mail the file (Not sure how to do this exactly, you could use SQL mail)
- Schedule the package (right-click on it, schedule package)
0
 
LVL 31

Accepted Solution

by:
James Murrell earned 300 total points
ID: 20333142
ok i think this could be done

1) open enterprise manager
2) right click on the database you want to export, and select all tasks/export data
3) the wizard opens.  click "Next"
4) accept the datasource as is, or select the datasource you want to export to excel.
5) change the destination to Microsoft Excel (and the version you want). also select the file you want to export to.
6) click next, then choose "copy tables..." and click next
7) select the tables and click next
8) make sure "run immediately" is the only option selected and click next
9)click finish and it will be done.


then takie a look at http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/DTS/Q_22826796.html?sfQueryTermInfo=1+email+send+sql

if you schedule both jobs should do it
0
 
LVL 10

Author Comment

by:orbulat
ID: 20333313
thanks all

i could export the table into a csv,

but i couldn't do it in "DTS package" nor the email stuff, any ideas?

i am new to use these functions, is there a way which i can 1. export to csv (csv name based on the date), 2. send mail with that csv as attachment at one time?

0
 
LVL 10

Author Comment

by:orbulat
ID: 20337050
ok, i figured how to do it nicely now :)

thx all
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now