Solved

dts to excel file that incoroprates date in name

Posted on 2008-10-08
4
262 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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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 different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

772 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

13 Experts available now in Live!

Get 1:1 Help Now