Skip to content
Advertisement

Find Multiple Substring from a String Using SQL

I have a column log. I need to extract values from that log column and make 4 new columns

My table: enter image description here

Output I need:

enter image description here

Advertisement

Answer

If the string really always follows exactly that format, you can use something funky like this:

Which gives:

This abuses the PARSENAME function, which is meant to parse 4 part named objects (server_name.database_name.schema_name.object_name).

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement