all groups > sql server dts > september 2004 >
You're in the

sql server dts

group:

Prob in Excel Data importing to SQL Server


Prob in Excel Data importing to SQL Server Shiv
9/29/2004 8:17:02 AM
sql server dts: Hi,

I am attempting to import data from an Excel spreadsheet into SQL 2000
I have 1 spreadsheet with 6 column headings

ProdID, Customer, Vendor, EffDate, EndDate, FixedPrice

I SQL Table with the same columns

ProdID int
Customer nvarchar
Vendor varchar
EffDate datetime
EndDate datetime
FixedPrice money

When I attempt to import the data from my spreadsheet into the SQL
table using DTS, I get the following error:

Error during transformation 'DirectCopyXForm' for row number 66.
Errors encountered so far in this task: 1
TransFormCopy 'DirectCopyXForm' conversion error:
Destination does not allow NULL on column pair 1 (source column
'ProdID' (DBTYPE_R8), Destination column 'ProdID' (DBTYPE_14))

Is there another way to import data into a SQL table which has a no NULL.


But I don't have the null value in my Excel Sheet

Any help concerning this issue would be greatly appreciated.
Thanks in advance

Regards
Re: Prob in Excel Data importing to SQL Server Allan Mitchell
9/29/2004 8:24:58 PM
The error is telling you that row 66 contains a NULL where you have
evidently specified NOT NULL for this column in SQL Server.

Does the data contain a NULL in the spreadsheet?

If it does then you need to fix up the spreadsheet or import it into a TABLE
that does allow NULLs for that column then use the ISNULL() function when
moving it over to the real table.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


[quoted text, click to view]

AddThis Social Bookmark Button