March 15, 2021 at 12:23 am
Let try below 2017 version
I'm not sure I understand what you're saying. If you mean to try it on something less than 2017, then here's what you get...
Msg 102, Level 15, State 1, Line 19
Incorrect syntax near 'FIELDQUOTE'.
Like I said, the code isn't going to work for versions less than 2017.
If you mean something else, then let us know, please.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 15, 2021 at 1:18 am
Hello all,
Maybe this is my own ignorance showing, but I think I've hit a brick wall. I can't seem to bulk insert a dataset. I create a temp table at the start of the query, and then try to bulk insert my .csv into it. Now, if I have a simple .csv to deal with, it works fine. However, we are trying to take a .csv that is being exported from a supplier's software and import it into the database. My problem is as is below.
1 2 3
500, 200, "1,000"
"7,000", 300, 500
50, "5,243", 232
Basically, as soon as they roll over 1,000, the software will export the number as "5,000", instead of 5000, . Any thoughts on how to cope with this? I would use a replace function of some kind, if I knew how.
I have it working in 2017 but, I have to ask... is your data actually double-spaced in the file like what you posted above?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 16, 2021 at 9:52 am
The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly. Msg 7330, Level 16, State 2, Line 1 Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply