I got the following entry in my database with column name - properties_desc:
#Thu Sep 03 02:18:11 UTC 2020 cardType=MasterCard cardDebit=true cardUniqueNumber=f0b03da93bc70fbc194a5a4ef5879685
I want to trim the entry so I get: MasterCard
So basically, I want everything after 'cardType=' and before ''.
I tried referring this Get everything after and before certain character in SQL Server but this works for a special character and not a string.
My try:
SUBSTRING(properties_desc, length(SUBSTRING(properties_desc, 0, length(properties_desc) - CHARINDEX ('cardType=', properties_desc))) + 1,
length(properties_desc) - length(SUBSTRING(properties_desc, 0, length(properties_desc) - CHARINDEX ('cardType=', properties_desc))) - length(SUBSTRING(
properties_desc, CHARINDEX (' ', properties_desc), length(properties_desc))))
But the above query does not work. Any help is appreciated. How can I solve it?