[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

Date conversion error is SSIS using Data Conversion Task

Hi Experts,

I have a package where i need to import the flat file (dailytally.csv) into a sql server table. I use data conversion tab between flat file and oledb destination. The import works fine except the datetime columns. Those columns are just taking the deault database timestamp instead of the actual timestamp in the file itself. I tried to change the data type from DT_DBDATE to DT_DBDATETIME and few others without any luck. Any suggestions appreciated. I have attached my package xml for your reference.
dailytally-ssis.txt
0
parpaa
Asked:
parpaa
  • 2
  • 2
1 Solution
 
Brendt HessSenior DBACommented:
I found the SSIS package attached, but not a sample of the data so I can see what values are actually in the datetime fields.

One suggestion - use the DT_DATE data type by preference.  This is much closer to SQL Server's internal structure.
0
 
parpaaAuthor Commented:
Thanks for your response! Yes i did try DT_DATE before and it didnt work. Iwill try it again today. I have also attached my sample data.
DailyTally-sample.xlsx
0
 
Brendt HessSenior DBACommented:
Can you send the sample as a CSV instead of an Excel spreadsheet - preferably, an actual edit of one of your CSV files with private data obfuscated?  This would make it easier to analyze, since an Excel file (for example) represents NULL values as the text string NULL, and frequently reformats the data from whatever is actually in the file.

Also, do you know which specific field in the CSV is causing it to fail?

Finally, if you simply try to use the import/export wizard in Management Studio to import the file directly into a new table, what suggested data types get used for the new table, and does the import fail?  If so, on what row (approximately).
0
 
parpaaAuthor Commented:
I have modified the file based on your requirements. The column in question are all the date column whihc are taking current db timestamp rather than actual value from the file. But you can look for 'Nom_date' column in particualr. LMK if you need  anything else.
DailyTally-sample.csv.xlsx
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now