?
Solved

Date conversion error is SSIS  using Data Conversion Task

Posted on 2012-04-11
4
Medium Priority
?
422 Views
Last Modified: 2012-04-23
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
Comment
Question by:parpaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 37835337
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
 

Author Comment

by:parpaa
ID: 37838567
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
 
LVL 32

Accepted Solution

by:
Brendt Hess earned 2000 total points
ID: 37839365
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
 

Author Comment

by:parpaa
ID: 37840245
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question