I think its gonna be BCP week for me. 😉
The text file i am loading is containing few columns with datetime dataype. In order to load this file into final table, i have to match the datetime format and convert it on the fly while loading data.
The date format in file is dd/mm/yy hh:mm where as my sql server table dateformat is yyyy-mm-dd hh:mm
I have already followed an approach to load the data in temporary table with varchar datatype and then write the sql with convert functions to load data into final table.
Is there any better way through which i could load the data, convert it on the fly using BCP