[dba-SQLServer] (no subject)

jwcolby jwcolby at colbyconsulting.com
Tue Jul 3 08:03:10 CDT 2007


Eric,

>I think you asked this question before...

No, in fact this is a different situation.  I am trying to load a (CSV, kind
of) text file into a table.  Inside of that text file there is a filespec
column.  THAT COLUMN is being barfed on when SQL Server tries to import it.


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Monday, July 02, 2007 10:24 AM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] (no subject)

John,

I think you asked this question before...

My recommendation is to assign the command to a variable and re-write it
like this...

SET @sql ='BULK INSERT YoueTable FROM ' + CHAR(39) + @DataFileName +
CHAR(39)  

...and then run the command like this...

EXEC (@sql)

Eric

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, July 02, 2007 6:00 AM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] (no subject)

Folks,

I am trying to import (through the wizard) a file path into a field in SQL
Server and am getting the following error.  This is literally one of the
strings:  \\Stonehenge\PSM\Data\infutor\CSVExport\Infutor1.txt . The error
message indicates that SQL Server doesn't like the \ or . character.  

Error 0xc02020a1: Data Flow Task: Data conversion failed. The data
conversion for column "FileSpec" returned status value 4 and status text
"Text was truncated or one or more characters had no match in the target
code page.".
 (SQL Server Import and Export Wizard)
 
Any idea how to make this OK with SQL Server?

John W. Colby
Colby Consulting
www.ColbyConsulting.com 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.14/883 - Release Date: 7/1/2007
12:19 PM
 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list