[dba-SQLServer] (no subject)

Nick nick at frasiervan.com
Tue Jul 3 21:14:02 CDT 2007


If you are using SQL Server 2000 and DTS, you can try attaching an activex
vbscript to handle the "//" which is probably causing the problem as it's a
double escape character.

Check these articles.

http://msdn2.microsoft.com/en-us/library/aa933488(SQL.80).aspx
http://msdn2.microsoft.com/en-us/library/aa933459(SQL.80).aspx

Inside the wizard it might offer an option to modify the import specs for
certain field mappings in the same way, but I'd need to check against which
version of SQL Server, it's different depending on if you are using EM or
SQL Management Studio.

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Tuesday, July 03, 2007 8:03 AM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] (no subject)

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

_______________________________________________
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