this proves that it's not the problem because it didn't truncate the number assigned in the mod of the code. I'm pretty sure that's not the problem here but I tried it. ![]() Attached is the screenshot of the test I performed. If you'll not assign the length then by default only one character is considered. You may try after correcting it.Īssign a length to the NVARCHAR in the following line of your code. If I was using a wrong delimitator, why does it still load so many records? I would have thought if the issue was the columns, I would get an error, but don't. I can't seem to figure out why this is happening. I edit the file to remove the vast majority, I get the same issue. I change the LASTROW value, I get the same. SET = (SELECT COUNT(*) FROM Temp_Systems)ĮXEC I run that code, here is the output.Īs you can see, I get roughly half the records. Here is thh code I am trying: DECLARE AS INT ![]() This file has about 300,000 records, and I have tried to remove 250,000 records, 299,000 records, no matter what I still only get half the records in the main table. I don't get any error message, and it doesn't seem to matter what I put in the "LAST ROW" value either. the other table is the main table(all columns are NVARCHAR(MAX) which I will change once I get the data to fully load, but did this to avoid any truncation or other data issues), where I try to load all the records using "LAST ROW" However, no matter what I do, I only get about 1/2 the records in the main table. One table is simply one column (NVARCHAR(MAX)) where I load the entire file starting at 3 so that I can get the number of records before the trailer file. Unfortunately, this is standard for our organization to include them, but I am not sure they are causing the issue. Our *.txt file has two rows of "header" data, and one row of "footer / trailer" data. I am trying to load a *.txt file using BULK INSERT, but no matter what I do, it seems to only load about 50% of the records.
0 Comments
Leave a Reply. |