BULK INSERT unix file

  • Can you post a sample of the file contents ?


    * Noel

  • I'm pretty sure \r is the row terminator for unix, and \n is the terminator for pc based text files. I've never used \n and \r together, that would be like finding vbCrLf vbLf side by side.

    i use editplus to see the differences, find and replace chars like this all the time.

    the field terminator for tab is \t

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Dear Noeld,

    I get zipped .dat file from the FTP. I have first unzipping the file op the server and then use it in the DTS.

    Now as I said before I need to inport the data of the file directly in an table in the SQL server 2000 without using the DTS. so.. it must be doen by using.. BCP of BULK INSERT.

  • That doesn't override the need for a sample of your data.

    I'd personally like to see 3-5 rows of data as it appears in your file (feel free to replace any sensitive values with dummy values that are semi-equivalent to the original), as well as 3-5 rows of the hex versions of said data. Without that, most of us are just guessing as to what exactly needs to be done.

    I can't speak for everyone else, but I'm not going to spend time creating a format file without a much better understanding of what your data looks like than what we have so far.

  • Again: *sample of the contents* , please ?


    * Noel

  • Here you are.. you can download the file from this link..

    http://www.mediafire.com/?efcdmj9n4x1

    thx..

    Cees

  • here are the hex editor view too, i used xvi32 hex editor.

    http://www.mediafire.com/?04y4uyj9tne

    thx again..

    Cees

  • Well.. it working.. I made manually a format file.. as fallowing:

    7.0

    1

    1  SQLCHAR 0  100  ""  1 column name  ... etc,  and then i used bcp utility to fill the table in the database

    Thx very much for yours reactions.

     

  • Happy to help.

    And BULK INSERT will work with the same format file as good as bcp.

    _____________
    Code for TallyGenerator

Viewing 9 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply