Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Inserting CSV File to SQL SERVER TABLE

Inserting CSV File to SQL SERVER TABLE

Scheduled Pinned Locked Moved Database
helpdatabasesql-serversysadmintutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ps_prakash02
    wrote on last edited by
    #1

    Hi, I'm having csv file which i tried inserting into sql server 2000 table through bulk insert my bulk insert statement Bulk Insert TableName From '\\FilePath\FileName.csv' With ( FieldTerminator = ',', RowTerminator = '\n' ) While Executing the SQL Statement, i'm getting the following error. Bulk Insert: Unexpected end-of-file (EOF) encountered in data file. i tried inserting through DTS it works. but i want to do through Application How to do that. Please Help Me.. Thanks, Regards, P.Prakash.

    C S 2 Replies Last reply
    0
    • P ps_prakash02

      Hi, I'm having csv file which i tried inserting into sql server 2000 table through bulk insert my bulk insert statement Bulk Insert TableName From '\\FilePath\FileName.csv' With ( FieldTerminator = ',', RowTerminator = '\n' ) While Executing the SQL Statement, i'm getting the following error. Bulk Insert: Unexpected end-of-file (EOF) encountered in data file. i tried inserting through DTS it works. but i want to do through Application How to do that. Please Help Me.. Thanks, Regards, P.Prakash.

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      Just a guess, but for the final record, is there a row terminator?

      Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

      P 1 Reply Last reply
      0
      • P ps_prakash02

        Hi, I'm having csv file which i tried inserting into sql server 2000 table through bulk insert my bulk insert statement Bulk Insert TableName From '\\FilePath\FileName.csv' With ( FieldTerminator = ',', RowTerminator = '\n' ) While Executing the SQL Statement, i'm getting the following error. Bulk Insert: Unexpected end-of-file (EOF) encountered in data file. i tried inserting through DTS it works. but i want to do through Application How to do that. Please Help Me.. Thanks, Regards, P.Prakash.

        S Offline
        S Offline
        Sabarinathan T
        wrote on last edited by
        #3

        Hi prakash, Check for the Extra spaces at the end of the file.If so remove those spaces and retry it.

        1 Reply Last reply
        0
        • C Chris Meech

          Just a guess, but for the final record, is there a row terminator?

          Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

          P Offline
          P Offline
          ps_prakash02
          wrote on last edited by
          #4

          In the CSV File i think i'm not getting proper row terminator (\n) at the end of the file. in that case how to proceed with bulk insert? One more thing while importing the same csv file through dts then i'm able to import the CSV File data to the table. but i want to do it in the applications. pls kindly help me. P.Prakash.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups