A T-SQL Query To Get The Text Between Two Delimiters In SQL Server

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024
  • Become a member! / @erikdarlingdata If you like what you see here, you'll love my advanced performance tuning training:
    training.erikd... Click here for 50% off a health check: training.erikd...

ความคิดเห็น • 11

  • @Garstor
    @Garstor หลายเดือนก่อน +1

    🎼🎶 Did you ever know that you're my hero? And everything I would like to be? I can fly higher than an eagle, for you are the wind beneath my wings 🎶🎵

    • @ErikDarlingData
      @ErikDarlingData  หลายเดือนก่อน +2

      I remember when this song first got popular via Bette Midler and I’d hear it on the radio in my mom’s car and I’m pretty sure it’s why I asked for a Walkman for my 8th birthday.

  • @micke444
    @micke444 29 วันที่ผ่านมา +2

    Too much fun, could not resist.
    Proper indentation is up to you, I find that to be the hard part 😅
    select cast((select replace((select m.text as '*' for xml path('')), N':', '')) as xml).value('text()[2]', 'nvarchar(2048)')
    from sys.messages as m
    where m.language_id = 1033 and
    m.text like N'%:%:%';

    • @ErikDarlingData
      @ErikDarlingData  29 วันที่ผ่านมา +1

      You’re a bad man. A bad, bad man 🥰

  • @douglascoats7081
    @douglascoats7081 หลายเดือนก่อน +1

    you can find all the occurrences of my thumbs with the content of this video lol Most of them are pointed upwards.

    • @ErikDarlingData
      @ErikDarlingData  หลายเดือนก่อน +1

      Woah woah woah how many thumbs are we talking here

    • @douglascoats7081
      @douglascoats7081 หลายเดือนก่อน

      @@ErikDarlingData at LEAST 17

  • @vasylpavuk391
    @vasylpavuk391 หลายเดือนก่อน

    Hi. One more idea:
    with first_iter as
    (
    select m.*, first_pos = charindex(':', [text])
    from sys.messages m
    where 1 = 1
    and m.language_id = 1033
    and m.[text] like N'%:%:%'
    ),
    second_iter as
    (
    select fi.*, second_pos = charindex(':', [text], first_pos+1)
    from first_iter fi
    )
    select *,
    first_arg = left([text], first_pos-1),
    second_arg = substring([text], first_pos+1, second_pos-first_pos-1),
    third_arg = substring([text], second_pos+1, len([text]))
    from second_iter