locked
Read Text file RRS feed

  • Question

  • Hi,

    I have the text file in my server.

    Is it possible to read that text file and insert into the table.

     

    pls advice

     

    Regards

    Antony

    Tuesday, April 24, 2007 12:26 PM

Answers

  • SELECT PVListFile.F1 AS mytxt INTO MyTable FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source="c:\";User
    ID="Admin";Password=;Extended Properties="text;HDR=No"')...filename#txt as PVListFile
    Tuesday, April 24, 2007 1:53 PM

All replies

  • SELECT PVListFile.F1 AS mytxt INTO MyTable FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source="c:\";User
    ID="Admin";Password=;Extended Properties="text;HDR=No"')...filename#txt as PVListFile
    Tuesday, April 24, 2007 1:53 PM
  • Refer to Books Online about using 'BULKINSERT', 'bcp', and/or 'OPENDATASOURCE'.

     

    See this recent thread about using bcp.

    Tuesday, April 24, 2007 2:00 PM