How can I debug a Bulk Insert error?

I'm loading a bunch of files into SQL server.  All work fine, but one keeps erroring out on me.  All files should be exactly the same in structure, but they have different dates, and other different financial metrics, but the structure and field
names should be exactly the same.  Nevertheless, one keeps konking out, and throwing this error.
Msg 4832, Level 16, State 1, Line 1
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
The ROWTERMINATOR should be CRLF, and when you look at it in Notepad++ that's what it looks like, but it must be something else, because I keep getting errors here.  I tried the good old:  ROWTERMINATOR='0x0a'
That works on all files, but one, so there's something funky going on here, and I need to see what SQL Server is really doing.
Is there some way to print out a log, or look at a log somewhere?
Thanks!!
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

The first thing to try is to see if BCP likes the file. BCP and BULK INSERT adhere to the same spec, but they are different implementations, but there are subtle differences.
There is an ERRORFILE option, but it more helps when there is bad data.
You can also use the BATCHSIZE option to see how many records in the file it swallows, before things go bad. FIRSTROW and LASTROW can also help.
All in all, it can be quite tedious find that single row where things are different - and where BULK INSERT loses sync entirely. Keep in mind that it reads fields on by one, and it there is one field terminator to few on a line, it will consume the line
feed at the end of the line as data.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • How can we Debug the workflow?

    Hi,
    How can we debug the workflow?
    Please help  me on debugging the workflow in step by step procedure?
    Early reply is highely appriciable.
    Regards,
    Chow.

    Hi,
    If you want to set breakpoints in method which is used in workflow task then it is possible
    till ECC5 am afraid about ECC6
    you can see the graphical view of workflow through transactions said by Kalpesh
    you can also use swwl (delete workflow) for viewing the container elements of the workflow.
    SWI2_ADM1:Workitem without agents
    SWI2_DIAG:Workflow with error
    these transactions are also helpful
    Thanks & Regards
    Hari Sankar M

  • How can i debug my abap program?

    hi. how can i debug my program?

    Hi,
    There are many ways to start debugger
    •     By clicking the Execute button and selecting the debugging mode.
    •     From the ABAP/4 editor, by executing a program choosing Program  Execute  Debugging from the menu.
    •     Setting breakpoint in the program
    Components of ABAP/4 debugger
    The debugger shows the program information using six different views.
    •     Fields: Displays the field contents.
    •     Table: Allows modifying the contents of internal table.
    •     Breakpoints: Displays list of Breakpoint in the Program.
    •     Watchpoints: Allows dealing with Watchpoints.
    •     Calls: System call status like Event, Form etc.,
    •     Overview: Presents the program structure, events, subroutines, and modules.
    •     Settings:  Displays the calling sequence within a particular event, up to the current breakpoint.
    All these options are shown in the following screen.
    Arrow indicates the breakpoint of the program i.e., where user has stopped the program.
    Breakpoints
    A breakpoint is the signal, which is specified in the program, tells the system to stop the program execution and to start the debugger.  Following types of breakpoint are available with ABAP/4:
    •     Static are set up with the BREAKPOINT keyword inside the program, which you can directly display with the ABAP/4 source code editor.  To set the breakpoint in the program enters the keyboard BREAKPOINT.
    •     Dynamic this breakpoint is not visible in the code.  Position the cursor over the source code line to have the breakpoint and then select utilities -  breakpoint -  set.  You can delete them or display them from breakpoint list.  Or you can execute the program in the ABAP/4 debugger i.e., in debugging mode.
    •     Watchpoints are field specific.  The program is stopped when the field reaches the value specified in the watchpoint.  Execute the program in debugging mode.  Position the cursor over the needed field.  Press the F button to get the view of field.  Select the checkbox for the needed watchpoint.  Click on the continue button.
    •     Keywords/events The program stops just before executing a specific event or keyword.  To set breakpoint at particular event, from initial screen of debugger, select Breakpoint  Breakpoint at  at event/at keyword.  Enter the name of the keyword or event.  Click on OK.
    Navigating through the breakpoint
    Following buttons are used to navigate through the program and debugger.
    •     Single step:  Executes a single program command.
    •     Execute:  Similar to the single step, but when a program calls a subroutine, it executes the whole subroutine unlike single step.
    •     Continue: Executes the program until it is finished or until it finds next breakpoint.
    •     Return:  Allows for executing the program instruction up to the end of a routine and stops in the line of code where the subroutine gives back control to the main program.
    •     Tables:  Switches the debugger to the table view.
    Displaying and modifying values
    Every time the program is stopped within a debugger, you can display and modify the contents of table field and fields.
    To display the fields, click on V and you can view the contents of system field, program field, ABAP/4 dictionary fields, and external program fields.
    Displaying and modifying internal tables
    When you click on the Table button from the initial ABAP/4 debugger screen, the system will display the table debugger view.  Here you need to enter the name of the internal table to be displayed.  You can modify or delete or add i.e., insert the internal table Contents.  These changes are applicable only for the debugging and do not affect the structure of internal table in the program.
    Reward.

  • How can I use multiple row insert or update into DB in JSP?

    Hi all,
    pls help for my question.
    "How can I use multiple rows insert or update into DB in JSP?"
    I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
    With thanks,

    That isn't true. Different SQL databases have
    different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
    I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
    and there are also a lot of different ways of talking to
    SQL databases that are possible in JSP, from using
    plain old java.sql.* in scriptlets to using the
    jstlsql taglib. I've done maintenance on both, and
    they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
    Well, sure. As long as you only want to update rows
    with the same value in column 2. I had the impression
    he wanted to update a whole table. If he only meant
    update all rows with the same value in a given column
    with the same value, that's trivial. All updates do
    that. But as far as I know there's know way to update
    more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
    Unless you're using MySQL, for instance. I only have
    experience with MySQL and M$ SQL Server, so I don't
    know what PostgreSQL, Oracle, Sybase, DB2 and all the
    rest are capable of, but I know for sure that MySQL
    can insert multiple rows while SQL Server can't (or at
    least I've never seen the syntax for doing it if it
    does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
    Don't assume that all SQL databases are the same.
    They're not, and it can really screw you up badly if
    you assume you can deploy a project you've developed
    with one database in an environment where you have to
    use a different one. Even different versions of the
    same database can have huge differences. I recommend
    you get a copy of the O'Reilly book, SQL in a
    Nutshell. It covers the most common DBMSes and does a
    good job of pointing out the differences.Yes, I understand that.
    It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
    I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
    The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing.

  • How can I throw a hard 404 error to apache when a JSP is not found.

    How can I throw a hard 404 error to apache when a JSP is not found.
    I want to let apache handle the error.

    [email protected] (Jeremy Conner) wrote in
              <[email protected]>:
              >How can I throw a hard 404 error to apache when a JSP is not found.
              >I want to let apache handle the error.
              >
              >
              First thought that comes to mind is to return HTML that tells the browser
              redirect to a nonexistent file under Apache. You can't tell Apache to
              throw a 404 unless you're in a mod. Maybe something they could add to the
              proxy, but until then, I think a redirection in the response HTML is your
              only option.
              Jesse
              

  • How can I perform a bulk assignment to one Task

    Hi All,
    I would like to allow all resources to assign some of their time to a cProjects Task (XXXX Implementation plan). How can I perform a bulk assignment to this task, instead of performing individual assignments?
    Please help.
    Thanks,
    Srini

    Not quite sure I fully understand your question. When you go to the "roles" tab of a task you are allowed to assign multiple resources to a task either from the same role or different roles. The total work or effort for the task can be distributed accross the multiple assignments.

  • How Can I Fix A QuickTime Codec Error?

    How Can I Fix A QuickTime Codec Error?
    I have several movies from 2008 that are labeled as .mov but I now get a QuickTime error saying "The document "XXXXXX" could not be opened. A required Codec isn't available."
    These movies ran in QuickTime just fine until about a month ago.
    All the folders in which these movies were stored in 4 folders in 2 folders in one folder. All folders at each level were encrypted with Stuffit Deluxe a version circa 2008 and decrypted with a newer Stuffit Deluxe 10.x. Other movies that are NOT .mov and in with the .mov movies still run.
    If I click on the Thumbnail Preview "It" runs.
    How can I fix this?
    TOP image is the Error message.
    BOTTOM image is the Thumbnail Preview info.
    I've checked out "Tell Me More" and have not found a solution.

    How Can I Fix A QuickTime Codec Error?
    The basic work flow is to determine which codecs were used to create the non-playing file and then check to see if these formats are supported by your current system codec component configuration.
    If the files will open in one of the QT player app, the open the inspector window to see which codecs were used to create the original file as seen here...
    or here in the "Format" entry...
    Or, if you have QT 7 keyed for "Pro" use, you can open the "Properties" window to gain even more information as demonstrated here...
    if you file will not open in either of the QT Player apps, then you can try opening the Finder "Get Info" window for the file,
    use a third-party media player that will open the file, or
    use a dedicated media information utility to learn this information....
    Once you know what codecs were used to create the file, post back with this information so we can deterine if the file should be natively supported by your Mac OS X install, requires an Apple Pro editing codec normally installed by the editor app, or requires a third-party codec which the user must supply.
    These movies ran in QuickTime just fine until about a month ago.
    All the folders in which these movies were stored in 4 folders in 2 folders in one folder. All folders at each level were encrypted with Stuffit Deluxe a version circa 2008 and decrypted with a newer Stuffit Deluxe 10.x. Other movies that are NOT .mov and in with the .mov movies still run.
    Your information does not indicate whether or not the files actually played on the current system or were transferred from a different system which was properly configured for playbac, whether or not you recently upgraded your operating system/modified your codec component configuration by adding or deleting any codecs, whether your compound "Stuffing" of the files created corruption, etc.
    As to MOV files the selves, this extension just implies the data was placed in the QT generic file container and the actually data could be of any compression format thathat was compatible with the codec component configuration for the system on which the files were created and could include natively supported system codecs, pro editing codecs, and/or third-party proprietary or hybrid codecs. (I.e., this is why we may need more information regarding the individual non-playing files.)
    If I click on the Thumbnail Preview "It" runs.
    f you are referring to QuickLook (QL) then the technology is different than QuickTime (QT). In the former case, the system is playing representative data but not actually opening the file as QT does. Thus, there is always the possibility that the problem is in the file structure (atom) information. For instance, suppose someone merely changed the MOV file extension in the Finder rather than actually copying data to a real MOV file container. Then it is possible that the QT player app may be searching for a codec that is not supposed or expected to be supported in the MOV file container and, not finding it, issues the erroneous codec error message—especially since you did not inticate the source of the file you are trying to play or, in some cases, which QT player is now not playing the file.
    In short, there are several possibilities here and not enough specific information.

  • How can i debug a rfc being called from sap

    hello Gurus,
    We made a RFC call from SAP r3 to sap grc nfe......we did not receive any data in sap grc .......we go to SM58 and there it gives
    the message "Name or password is incorrect (repeat logon)u201D.
    How can i find out where the data has stuck.
    Please help.
    BR
    Honey

    HI,
    please have a look at the link below..
    this may help u !!!
    [Re: how can i debug a rfc being called from .net connector (NCO) v2.0?;
    Best of Luck !!1
    Regards
    Ravi

  • How can I debug a routine created in Deletion of similar requests?

    Hello Experts,
    I need some help from you. I need to delete overlapping requests and the common
    settings you can set are not suitable, so I decided to write my own ABAP routine.
    But how can I debug a routine, which is implemented in the deletion of similar requests?
    Hope you can help me.
    Cheers
    Daniel Weilbacher

    Please go to the routine code..
    In the menu options..u will find an option for breakpoint--set..
    The line where breakpoint is set will get highlighted and u will also see a STOP symbol..
    then come out of routine..and then run the data load..
    this ABAP routine for overlapping request deletion runs before the scheduled data load..
    the run shud stop at the set breakpoint and show the routine code..in debugger mode..
    cheers,
    Vishvesh

  • How can I debug a sequence that has a subsequence is running in a separate thread?

    Hi,
    How can I debug a sequence that has a subsequence is running in a separate thread?
    I have to have a continues check for a  digital in signal to be able to terminate the sequence if a physical button is pushed.
    This is running in a separate thread, but this way I cannot debug the main sequence.
    Is there any workaround for this?
    Thanks,
    Andras

    This KB might help you:
    http://digital.ni.com/public.nsf/websearch/46D1E157756C37E686256CED0075E156?OpenDocument
    Let me know if this does not help.
    Allen P.
    NI

  • TS3694 How can I fix this type of error in iphone 4?"The iphone could not be restored. An unknown error occurred (3194) "please help me.

    Hi everybody !
    AT&T company is unlocked (factory)my iphone4 before 3 days ago so i want to restore to unlock iphone 4 with itunes but it is not restore.
    How can I fix this type of error in iphone 4?- "The iphone could not be restored. An unknown error occurred (3194) "
    please help me in nepali language(if posible) or english. thank you.

    http://support.apple.com/kb/TS3694#error3194
    This means that either your firewall/antivirus is blocking access to Apple's servers, or you have used your computer to jailbreak an iDevice in the past. The link above tells you how to resolve this issue.

  • How can I get Siri to insert a pause (,) when voice-dialing a number?

    I join a lot of conference calls with my iPhone.  The conference bridges have phone numbers that follow this pattern:
    (123) 456-7890,1234567#
    How can I get Siri to insert the pause (,) character, and the pound (hash) sign, into the phone number when voice-dialing?
    When I say "pause" Siri inserts the word "pause" as a literal string: 
         Example: (123) 456-7890 pause 1234567
    When I say "comma" Siri will insert a comma (,) into the dial string, but the Phone app ignores everything after the comma and does not dial it:
         Example: (123) 456-7890, 1234567   results in only this being dialed:  (123) 456-7890
    When I say "pound" or "hash" Siri inserts the words "pound" or "hash" as literal strings:
         Example: (123) 456-7890, 1234567 pound     instead of (123) 456-7890,1234567#

    If it is your own conference bridge you can create a new contact named "My Bridge" and enter your 1800 number along with a "wait" command and pass code and #.  It would look something like this 1-800-555-5555;12345678#.  This way when you tell Siri to call "My Bridge" she'll dial and then you'll notice an option in the lower left to dial the pass code.  Press that and you're all set. You can do the same for frequent conference bridges you connect to.  Hope this helps.

  • How can i use BAPI to insert a few records  into standard table

    Can anyone help me with how can i use BAPI to insert some records into a standard table from an internal table?

    Hi,
    First of All try to Explain your Question first.
    This is a general question without mentioning the Table you want to Update.
    Please give the details before posting a question  so it will help people to understand your Problem.
    Regards
    Sandipan

  • How can I pick in bulk in one LPN and drop on the staging by sales order

    How can I pick in bulk in one LPN and drop on the staging by sales order
    I have 25 sales orders
    I need to pick these orders in bulk in one batch (Batch means load all the sales order without existing the scree)
    during drop I need to drop by sales order
    do you have a solution or similar solution for that

    How can I pick in bulk in one LPN and drop on the staging by sales order
    I have 25 sales orders
    I need to pick these orders in bulk in one batch (Batch means load all the sales order without existing the scree)
    to pick all bulk and independent tasks tog ether
    during drop I need to drop by sales order (I mean to collect all the line of the sale order)
    do you have a solution or similar solution for that

  • How can I debug webdynpro java application?

    hi,
    How can I debug webdynpro java application?
    Thanks

    Check this document
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0cb32c5-36a7-2910-2c9b-ba4a5bbdbb56
    Also check this sdn thread Re: DeBugginng The WebDynPro Application particularly shailesh kumar posting
    /padmanaban
    Edited by: Padmanaban on Sep 26, 2008 1:55 AM

Maybe you are looking for

  • More than one sender with only one comunication channel

    Hi experts. I need to know that it is possible to make a one File FTP sender comunication channel with more than one host. If that is not possible, how could get that functionality? Thanks! Regards.

  • Error in Jboss while creating User

    Hey, I am getting below errors in Jboss when trying to create user (manually or recon) Insufficient method permissions, principal=null, ejbName=tcLookupOperations, method=create, interface=LOCALHOME, requiredRoles=[User], principalRoles=[] [DATABASE]

  • Column order in the template

    I need to migrate the existing reports from SQL Server Reporting Services to Crystal Report 2008, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I

  • TES 6.1.x - how do you tell what DB is used by ClientMgr?

    We just externalized the Client Mgr DB to Oracle, updated config files, etc. How do you tell what db is using - Derby or Oracle?        

  • When will apple change the color grey and white?

    I may be color blind and have trouble seeing certain colors but that doesn't make colors a bad thing thing for itunes. One reason I don't like using to much my itunes is for the fact I can't change the color. It's rather a big issue for me because I