Uploading data SQL - next problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert K

    Uploading data SQL - next problem

    hello, thank you for hint but:

    i want to read this data from file
    My file.txt file is like it:
    "
    1234567890
    abcdefghij
    " etc

    1 column | second column | third column
    -----------------------------------------
    12 | 3456 | 789
    ab | cdef |ghij
    how to do it ,
    [color=blue]
    > One option is to create a staging table with one column, load the data
    > into that table without changing it, then insert into the final table
    > like this:
    >
    > insert into dbo.TEST (col1, col2, col3)
    > select left(StagingCol umn, 2), left(StagingCol umn, 4),
    > left(StagingCol umn, 4)
    > from dbo.StagingTabl e[/color]

    the result is of this is
    1 column | second column | third column
    -----------------------------------------
    12 | 1234 | 1234
    ab |abcd |abcd


    Regards, Robert


Working...