July 20, 2011 at 3:54 pm
I am bulk importing a list of product SKUs into a table from a csv file. I have a strange character in some SKUs
AS-SD2PÔ0081
and after insert the SKU in the tabe is
AS-SD2P+0081
Can anybody help me figure out why this character is modified and how to correct?
Table has 2 columns.
mpSKU - varchar(50)
qbSKU - varchar(50)
CSV file created in excel. Looks correct opened in notepad. Only 2 columns. Sample Data:
mpSKU,qbSKU
AS-SD2PÔ0081,SD2P-AN
AS-SD2PÔ0082,SD2P-AN
AS-SD2PÔ0083,SD2P-AN
AS-SD2PÔ0084,SD2P-AN
My Insert Code
BULK INSERT SKUConversion
FROM '\\shipping\Shared\skuconversion.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = ''
)
Any help for this newbie would be appreciated!
-Joe
July 20, 2011 at 4:57 pm
I can't say I understand it, but found this fix on another forum and added to my query. It is now working! Funny how you can hunt and hunt and once you create a post, you find the answer 😀 ADDED: CODEPAGE = 'RAW'[/u]
BULK INSERT SKUConversion
FROM '\\shipping-pc\SkakawackSharedFolder\Shared Dejonet Docs\skuconversion.csv'
WITH
(
FIRSTROW = 2,
CODEPAGE = 'RAW',
FIELDTERMINATOR = ',',
ROWTERMINATOR = ''
)
July 21, 2011 at 8:01 pm
CodePage = 'RAW' simply supresses any codepage conversions. There's more information in Books Online on the subject under "BULK INSERT".
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply