method read a text file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raymond Chiu

    method read a text file

    Dear all,

    Now I have the simple task to read text file line by line into database (SQL
    Server 2000).
    If the text file is divided into different fields according to the number of
    characters, What is the best method to read into database.
    In Oracle, I know it has sql loader. As to SQL Server, What should be? Do I
    need to write the program to read each characters and line by line?

    Thanks,


  • rowe_newsgroups

    #2
    Re: method read a text file

    On Aug 20, 3:34 am, "Raymond Chiu" <rchiu...@yahoo .com.hkwrote:
    Dear all,
    >
    Now I have the simple task to read text file line by line into database (SQL
    Server 2000).
    If the text file is divided into different fields according to the numberof
    characters, What is the best method to read into database.
    In Oracle, I know it has sql loader. As to SQL Server, What should be? DoI
    need to write the program to read each characters and line by line?
    >
    Thanks,
    If you want a SQL Server answer then you're in the wrong newsgroup -
    you need to go to the one for SQL Server.

    If you want a solution in VB.NET, first stop by google.com and search
    for how to read a text file from .NET. There should be plenty of
    examples out there.

    Thanks,

    Seth Rowe [MVP]

    Comment

    • Phill W.

      #3
      Re: method read a text file

      Raymond Chiu wrote:
      Now I have the simple task to read text file line by line into database (SQL
      Server 2000).
      If the text file is divided into different fields according to the number of
      characters, What is the best method to read into database.
      Have a look at the bcp utility (SQLServer equivalent of the big O's
      SQLLoader). It should be able to do what you want.

      HTH,
      Phill W.

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: method read a text file

        "Raymond Chiu" <rchiu5hk@yahoo .com.hkschrieb:
        Now I have the simple task to read text file line by line into database
        (SQL Server 2000).
        ConnectionStrin gs.com - How to connect to Textfile
        <URL:http://www.connections trings.com/?carrier=textfi le>

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        Working...