Using the BCP utility ->
With a degree character in the flat data file, can anyone deliver this to a table without SQL Server changing it to stacked bar:
CREATE TABLE "dbo"."F_conv"
(
"col1" VARCHAR(21) NOT NULL
)
;
myformat.fmt
8.0
1
1 SQLCHAR 0 30 "\r\n" 1 col1 ""
mydata.dat file
1332 NS 4 Tall 32 oz
bcp command
bcp "MY_DB"."dbo"."F_conv" in "mydata.dat"
-q -S<server> -Usa -Psa -f"myformat.fmt"I don't think declaring the column as VARCHAR(...) will satisfy your requirements. I changed your sample to NVARCHAR(32) for the column and got a little closer (char(166) instead of char(176) for the degree sign) and then was able to perform a REPLACE on the column. I am pretty sure you also need to address collation of the column to ensure that your data gets imported correctly.|||Try taking BCP out of the picture, and use:CREATE TABLE dbo.tDstachon (
col1 CHAR(21) NOT NULL
)
GO
BULK INSERT dbo.tDstachon FROM 'c:\dstachon.txt'
BULK INSERT dbo.tDstachon FROM 'c:\dstachon.txt' WITH (CODEPAGE = 'ACP')
SELECT * FROM dbo.tDstachon-PatP|||thanks guys.
cheers,
d.
没有评论:
发表评论