Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Congratulations for your great site. This site helped me more than university..."

Geography

Where in the world do Tek-Tips members come from?

Visual Studio - DTS package to create new txt file using script

arodri (TechnicalUser)
23 Jun 11 16:52
Hello,

I have a Visual Studio 2005 dtsx package that I created and then imported to SQL Server Agent as a job that is scheduled to run daily. The package basically executes sveral stored procedures (in SQL server mgmt studio) that populate a CUSTOMER table and a TRANSACTIONS table. Then it selects everything from both tables, and puts the contents into two txt files (Cust.txt , Trans.txt).
Right now, there are only 2 txt files that I listed as Connections and everytime the job runs, it just overwrites everything that is in each txt file.

I've only ever created pretty simple jobs, so I'm stuck on the next step that I need to create:

Instead of having only 2 txt files, I need the package to create a 2 new ones (one for CUSTOMER and one for TRANSACTIONS) each day and name those files with the date that's in the data  - it's not the current date though. The data is going 7 days back (DATEADD(day, -7, GetDate())) so the new file name should be: Cust6-16-11.txt

I'm not sure how to create new txt files without having them already out there to establish them as connections in the Connetion Manager...? I'm guessing this might require some sort of scipt?  

Thanks in advance for any help.  

 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close