Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk Insert from a text file (from Access 2000) to SQL 2000

Status
Not open for further replies.

Nickela

MIS
Oct 22, 2002
29
US
I exported a table from an Access 2000 Database into a text file that I am using to import into a table in SQL 2000 through DTS. I have created a format file that defines the columns in the text file and maps them to the appropriate columns in the SQL table. When I run the DTS Package, I receive an error that says:

Bulk insert data conversion error (type mismatch) for row 2, column 7 (StartDate)
Bulk insert data conversion error (type mismatch) for row 1, column 7 (StartDate)

The StartDate field in the Access 2000 Database was defined as Date/Time and is defined as SmallDateTime in the SQL 2000 table

I have tried defining the StartDate field in the format file as SQLDateTim4 and SQLDateTime and receive the same error. Any thoughts on how to fix this?

Thanks for your help,
Nickela
 
Try changing smalldatetime to Datetime in sql2000.
 
Thanks for the response smin,

I modified the column in the table in SQL 2000 from smalldatetime to datetime and am still receiving the same error.

In the text file that I created the StartDate field has a first entry of:

1/4/2001 0:00:00

Any thoughts on anything else I could try and modify?

Thanks for your help.

Nickela
 
Here are some things you can try.

Try SQLCHAR instead of SQLDATETIME in your format file.
Have DTS to generate format file for you.
Have Access to export the date column in '01/04/2001 00:00:00' format. SQL server might like that better.
Import the date column in varchar form and do something about it later.
Or direct import/export from Sql Server/Access and at the same time export to flat file.

etc..
 
Hi,

I was wondering if it would not be easier to just use the DTS to import directly from the Access table.

Carla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top