Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

BCP query out file naming question

$
0
0

Is it possible to pull data from the db and make it part of the queryout filename.    It would be Date time stamp and trailer#.csv

set SAVESTAMP=%DATE:/=-%@%TIME::=-%.csv
set SAVESTAMP=%SAVESTAMP: =%
bcp "SELECT holmandb.dbo.tlcentry.tl_ID, holmandb.dbo.tlcentry.recordno, holmandb.dbo.tlcentry.tl_recvr, holmandb.dbo.tlcentry.tl_trailer_no, holmandb.dbo.tlcentry.tl_sku_no, holmandb.dbo.tlcentry.tl_julian_date, holmandb.dbo.tlcentry.tl_ac_no, holmandb.dbo.tlcentry.tl_time, holmandb.dbo.tlcentry.tl_qty_no, holmandb.dbo.tlcentry.tl_partialflag from holmandb.dbo.tlcentry " queryout "s:\Material Handling\Holman\Load Reports\tlreport_%SAVESTAMP%" -Slocalhost\HOLMAN -T -c -t, -r\r


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>