Solved

dts to excel file that incoroprates date in name

Posted on 2008-10-08
4
268 Views
Last Modified: 2013-12-25
I'm trying to use MSSQL 2000 DTS to query a database and save the results in a local file. That file just needs to have a unique file name. So I just want to use the date in the file name. Since I have no experience with VB in DTS, I just want to do a save as in the DTS.

Norman.
0
Comment
Question by:mmandrax
4 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 25 total points
ID: 22675576
See here:
How can I change the filename for a text file connection?
http://www.sqldts.com/200.aspx
0
 
LVL 31

Assisted Solution

by:James Murrell
James Murrell earned 25 total points
ID: 22694484
i use a batch file to change the name after the file is created

something like

@echo off
set thedate=%date% %time%
ECHO %thedate%
set yyyy=%thedate:~10,4%
set mm=%thedate:~4,2%
set dd=%thedate:~7,2%
set hh=%thedate:~15,2%
set mi=%thedate:~18,2%
copy filename.csv filename_%yyyy%%mm%%dd%%hh%%mi%.csv

0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

840 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