• Eirikur Eiriksson - Thursday, February 8, 2018 9:54 AM

    DataAnalyst011 - Thursday, February 8, 2018 9:28 AM

    Hi All,

    I'm needing to split a 60 character string every third character with spaces/pipes and filter out any set that is '000'. For example, this:

    '158001006000000000000000000000000000000000000000000000000000'

    would become this...

    158 | 001 | 006

    Here is some sample table (not my design!)

    CREATE TABLE MyTable (Column1 VARCHAR(MAX) SPARSE)

    INSERT INTO MyTable VALUES
        ('158001258006000000000000000000000000000000000000000000000000'),
        ('158001006000000000000000000000000000000000000000000000000000'),
        ('158267001118365397398399006000000000000000000000000000000000'),
        ('112070001365006000000000000000000000000000000000000000000000')

    Any help is GREATLY appreciated!

    This is trivial, what is the purpose?
    😎

    A just question! Each set of three constitutes a code that our business users understand. They want it piped out and filtered for readability.