Solved

Date conversion error is SSIS  using Data Conversion Task

Posted on 2012-04-11
4
415 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
  • 2
  • 2
4 Comments
 
LVL 32

Expert Comment

by:bhess1
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:
bhess1 earned 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now