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!

Invalid character value for cast specification import error

Status
Not open for further replies.

p27br

Programmer
Aug 13, 2001
516
GB
hello

i am attempting to import a CSV file into SQL Server 2005.
A record looks like this :

"sometext","moretext","moretext","WEEK 200614","4.50000","19.32400"

I want the 2 last fields to be imported into decimal fields, but SQL throws an error :
Code:
 Copying to [bla].[dbo].[mytable] (Error)
	Messages
	* Error 0xc0202009: Data Flow Task: An OLE DB error has occurred. Error code: 0x80004005.
	An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
	An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
	 (SQL Server Import and Export Wizard)
	
	* Error 0xc020901c: Data Flow Task: There was an error with input column "Column 4" (85) on input "Destination Input" (47). The column status returned was: "The value could not be converted because of a potential loss of data.".
	 (SQL Server Import and Export Wizard)
	
	* Error 0xc0209029: Data Flow Task: The "input "Destination Input" (47)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "Destination Input" (47)" specifies failure on error. An error occurred on the specified object of the specified component.
	 (SQL Server Import and Export Wizard)
	
	* Error 0xc0047022: Data Flow Task: The ProcessInput method on component "Destination - NPWYEW01new2" (34) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
	 (SQL Server Import and Export Wizard)
	
	* Error 0xc0047021: Data Flow Task: Thread "WorkThread0" has exited with error code 0xC0209029.
	 (SQL Server Import and Export Wizard)

i didn't have this type of error with SQL 2000, with the same files !!
 
Are you using a different setup of your database and the decimal separator has changed from a . to a , or vice versa?
 
Aargh !

I forgot to set the "text delimiter",
it's working fine now !

thanks anyway :)

but I must say those error messages aren't very helpful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top