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

Appending DATE TIME to CSV file name

$
0
0

Hi,

SSIS 2005 

I am generating some .CSV file using flat file destination and to this file name I want to append DATE TIME (getdate())

So I am creating two variable @File_Pathand @Dt_File_Name

@File_Path : E:\Folder

and for @Dt_File_NameI am using below expression.

SELECT CONVERT(VARCHAR(12), GETDATE(), 102) ,  CONVERT(VARCHAR(12), GETDATE(), 108)

output of this :  2016.10.12      13:23:51

While setting connection string of flat file manager I am using

@[User::File_Path]+ "ABC_" +
@[User::Dt_File_Name]  +"_" +  
".CSV"

However, if I just use date format only then only it is executing fine (i.e. just SELECT CONVERT(VARCHAR(12), GETDATE(), 102)

The moment I try to use TIME part (i.e.  CONVERT(VARCHAR(12), GETDATE(), 108

It is failing with error :

[Flat File Destination [1309]] Error: No destination flat file name was provided. Make sure the flat file connection manager is configured with a connection string. 
If the flat file connection manager is used by multiple components, ensure that the connection string contains enough file names. 

Can you suggest how do I use DATE_TIME after my file name

Regards


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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