Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Importing a text file

    Hi all I need to import a text file into sql server 2014 I was going to use the import wizard but I'm not sure how to separate the columns. In the each section/column is separated by ###, !!!!, @@@@@ and &&&

    Code:
     !!!OXIDE REPLACEMENT@@@MICROETCH###Active Oxygen Content 748$$$ANAL%%%0.8000  g/l^^^15.92&&&H.HalperTTT201507010626???INSPECOoCN/A
    I'm not sure to separate those into columns, can anyone help please

    Code:
     ULK
    INSERT LabWizardData
    FROM 'C:\Users\Administrator\Documents\201507.txt' --location with filename
    WITH
    (
    FIELDTERMINATOR = '@@@ ,%%%, &&&, ???',
    ROWTERMINATOR = '\n'
    )
    GO
    was going to do a bulk insert but I keep getting this message Msg 208, Level 16, State 82, Line 3
    Invalid object name 'LabWizardData'.
    Last edited by desireemm; 07-11-15 at 02:42.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Edit the text file...make the delimiters "," the way EVERYONE does it.

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Yes I figured it out I edited the text I made all the special characters commas with find and replace all and now I'm fine

    thank you

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •