Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Extracting Specific data from Rows:

Extracting Specific data from Rows:

Scheduled Pinned Locked Moved Database
databasesql-servercomsysadminhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahzad Aslam
    wrote on last edited by
    #1

    Hi Friends, I am having problem with extracting data from a field which has datatype text in sql server 2005. Following is the two sample rows which contains the field. 1. TrackID14910417OrderID1019RefReason1019Src21244700309600019SID13640214PayCh13MJA210PurchaseID10218 2. TrackID145493211Description235USE+IT+UP+AND+WEAR+IT+OUT+-+ODYSSEY17OrderID10210PurchaseID1019RefReason10214PayCh13MJA16UserID23642B942B8-05D0-4447-BEEC-7EF11419368B217CVFDate1019SID13640213TID1019Dst21244700059600 I want to extract TrackID value from above two rows, the length of the values may vary, it might be 8,9 or 10 digits long.

    Shahzad Aslam Software Engineer Softech Systems Limited Email: shehzadaslam@hotmail.com

    C 1 Reply Last reply
    0
    • S Shahzad Aslam

      Hi Friends, I am having problem with extracting data from a field which has datatype text in sql server 2005. Following is the two sample rows which contains the field. 1. TrackID14910417OrderID1019RefReason1019Src21244700309600019SID13640214PayCh13MJA210PurchaseID10218 2. TrackID145493211Description235USE+IT+UP+AND+WEAR+IT+OUT+-+ODYSSEY17OrderID10210PurchaseID1019RefReason10214PayCh13MJA16UserID23642B942B8-05D0-4447-BEEC-7EF11419368B217CVFDate1019SID13640213TID1019Dst21244700059600 I want to extract TrackID value from above two rows, the length of the values may vary, it might be 8,9 or 10 digits long.

      Shahzad Aslam Software Engineer Softech Systems Limited Email: shehzadaslam@hotmail.com

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I guess you need to pull out ten characters, and then parse them. In future, perhaps you can think of a more sensible format :-)

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 1 Reply Last reply
      0
      • C Christian Graus

        I guess you need to pull out ten characters, and then parse them. In future, perhaps you can think of a more sensible format :-)

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        S Offline
        S Offline
        Shahzad Aslam
        wrote on last edited by
        #3

        yes 10 characters needed and then need to parse them, it could be a sensible format in the future but currently we have to continue with this..

        Shahzad Aslam Software Engineer Softech Systems Limited Email: shehzadaslam@hotmail.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups