So I'm NOT as SQL expert by any means. Here is the scenario.1. I'm using a sql data base with MSFT RMS point of sale. I've used an import utility many times to import inventory into my data base using and.csv file. Done it many times with 100's of rows. I was testing my news import by grabbing, in this case 19 rows of data. I successfully imported the 19 rows and was ready to import the lion share 500 rows. Somehow the import previously has now made it so i can't import more than 19 rows. If i select 15 items, it duplicates row 15 4 times to maintain the 19 rows.
By chance I was in the process of swapping out the hardware that hosts the SQL database and upgrading my SWL server to server studio 2017 from a previous version. I thought this would solve my problem. Nope. Of course i can't start with a new database so to me, it's something in the database that has somehow throttled the ability to import anything more than 19.
I've gone to different workstations, same result. reinstalled new version of the import utility, same issue. Does anyone have any ideas, 1, WHAT THE PROBLEM IS? 2. HOW DO I FIX IT?
Thank you in advance.
Answer by shahzaib5 ·
Try to import that exact file using this query and see what it does:
BULK INSERT #temp --your table name
FROM 'D:\file.csv' --set your path
FORMAT = 'CSV',
FIELDQUOTE = '"',
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
Answer by Jeff Moden ·
From the original post:
"I've used an import utility ... "
How on this good Green Earth do you expect anyone to be able to help you without you being crystal clear about not only WHICH utility you used but exactly how you used it when when this problem occurred. If it's not specifically something from SQL Server, you should get ahold of the folks that made the utility and explain it all to them. If it is an SQL Server utility you used, you have provided absolutely zero info that can give us a clue as to what went wrong except to say that you left a setting set somewhere.
I'll also tell you that no SQL Utility wlll duplicate the last row to make sure that you have X number of rows. You must have written some form of left outer join if it's SQL Server stuff or they did so in the 3rd party stuff that you're using.
The bottom line is that you've really not provided enough info for anyone to stand a chance of helping you. @willySQL is trying simply by forcing you to do something a certain way so we can start to see what you're doing.