Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
355 views
in Technique[技术] by (71.8m points)

Day and Year got swapped SSIS and SQL Server

I got strange issue between SSIS and SQL Server.

I've developed SSIS to read CSV flat files and upload the files to SQL Server. Everything is working great and perfectly. The strange issue is that out of 1000 records that SSIS is importing 200 records have an issue with date where the date data are getting swapped the day became in the place of the year and the year in place of the day.

This is an example of perfect row and problematic row

Perfect row:

2018-12-17 09:05:00.000

Problematic row:

2017-12-18 09:05:00.000

Anyone faced the same issue or knows how to solve please assist.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just try to convert the date format while loading into tables in ssis/after loading into table just update the records into a proper datetime format using convert function in backend.

In Csv itself getting mixed format in the sense just push it into staging table and split up the problematic records and correct the source data.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...