SQL Server Developer Center > SQL Server Forums > SQL Server Express > Inserting Bulk Data using SQL Server 2008
Ask a questionAsk a question
 

QuestionInserting Bulk Data using SQL Server 2008

  • Thursday, November 05, 2009 5:49 AMreach2sjs Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I am trying to insert bulk data which is stored in the text file by using the above query

    Query:-

    BULK INSERT Stud
       FROM 'c:\\Test.txt'
       WITH
         (
            FIELDTERMINATOR =','
         )


    There are 10000 records in the text file.

    It showing the result that 10000 rows affected. But Actually only 200 rows inserted.

    I want to do bulk insert.

    Thanks,
    reach2sjs

All Replies

  • Thursday, November 05, 2009 6:39 AMLekssAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Did you run a select count(*) from the table ?

    Thanks, Leks
  • Thursday, November 05, 2009 6:50 AMreach2sjs Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yes...but it showing 200 records when I open table. It gives me the same count as I insert that many records. e.g. If the file contains 10000 records it showing the same count if i execute count query.
  • Friday, November 06, 2009 7:57 AMMelissa Suciadi Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    so what happen is you try to insert a file with 10000 rows but what you got is only 200 rows inserted?

    Best Regards,
    Melissa Suciadi


    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.