Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 remote batch job and text file questions

Author  Topic 

NiceSituation
Starting Member

22 Posts

Posted - 2007-09-21 : 15:12:16
Hello, I am new to these forums, as well as to SQL Server 2000. I am not sure if this post belongs on this forum, but I believe it does. Recently I created a few views to get specific data from different tables and have it well organized and quickly available. Now, I wish to do the following: I would like to set up a batch job (or anything similar, the idea is that it is executed in the server every day at a certain time) which will call a number of stored procedures that will extract all data from each view (basically just run the queries to extract the data from the views). The data extracted for each view is to be exported to a flat text file with a certain format (delimiters, etc.) and will be sent to (or imported by) another server, where the files will be stored in a specific path. However, I am quite lost here, and I haven't found much info. on the web on how to do all that stuff that I just wrote. Can anyone help me out please?

Thanks in advance.

May today be good, and tomorrow better

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-22 : 00:03:20
Yes you can run the process as scheduled sql job, look at books online on how to create job.
Go to Top of Page

NiceSituation
Starting Member

22 Posts

Posted - 2007-09-26 : 17:46:18
quote:
Originally posted by rmiao

Yes you can run the process as scheduled sql job, look at books online on how to create job.


Ok, I've checked out Books Online and most of my questions are now answered. However, I am still missing how to place the results of the queries in the text file with the appropriate format (the most important thing is the separator between fields and the end of each row) and how to schedule the server to send the files to the other server (or schedule the other server to look for those files). Any suggestions?

May today be good, and tomorrow better
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-09-26 : 23:17:41
Call the query in osql, you can specify output file. Then add a step in the job to copy file, keep in mind that you can run dos command in sql job.
Go to Top of Page
   

- Advertisement -