Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

bcp file transfer not working after adding datetime behind the output file name.

$
0
0

I like to add date (yyyy_MM_dd) behind output file , after adding $startTime variable , it's not working . Seems file format is not correct . Could you tell me where is wrong ?

$startTime = Get-Date -UFormat "%YYYY _ %mm _%dd"
bcp DB_AA.dbo.tbl_AA_Export_Table out ("\\server1\IncomingFile\folder1\DB1\DB_AA_Daily_Output_"+  $startTime  + ".txt") -T -c


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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