Lollipop   

Welcome to PcCare.com

Import csv date fields to SQL Server

Start->SQL Server 2008->Import and Export Data

 

Create an import/export package.

 

This examples csv date format  is "1:12 PM 1/9/2009".

 

Change the SQL server table's date columns data type to DateTime

 

Drop and drag the .dtsx file created in during import/export package above to Sql Server Managment Studio's Workspace window

 

Select the SourceConnectionFlatFile icon at bottom of window.

 

Right Click->Edit->Advanced->Date Column->

 

Change data type from Unicode String DT_WSTR to Date DT_DATE.

 

Menu->File->Save->xxxx.dtsx

 

Double click xxxx.dtsx to re-execute the import. The updated column should now have the date values stored as DateTime.

 

 

 

 

 

 

 

DISCLAIMER: It is assumed that users are familiar with the operating system they are using and comfortable with making the suggested changes. PcCare.com will not be held responsible if changes you make cause a system failure.

Please review our Terms of Service and Privacy statement before initiating service or using this site. Microsoft® and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. PcCare Site Map. About Us

PcCare.com is owned and operated by TechnoChill Inc.