how to split a coloumn into 5 coloumn

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • supermen
    New Member
    • Jan 2008
    • 1

    how to split a coloumn into 5 coloumn

    to all, how to split a column into 5 coloumn.
    e.g
    column= 1 2 1 3 4

    into
    colomn1 = 1
    colomn2 = 2
    colomn3 = 1
    colomn4 = 3
    colomn5 = 4

    thanks a lot
  • camel
    New Member
    • Jan 2008
    • 55

    #2
    You could use SUBSTRING

    Comment

    • Delerna
      Recognized Expert Top Contributor
      • Jan 2008
      • 1134

      #3
      If there are any numbers in the sequence greater that 9 then
      you can use CHARINDEX to find the location of the spaces
      for use with substring

      Comment

      • Delerna
        Recognized Expert Top Contributor
        • Jan 2008
        • 1134

        #4
        If you need help with charindex then just ask and I will provide an example

        Comment

        Working...