Get everything after and before certain character in SQL Server

use the following function

left(@test, charindex("https://stackoverflow.com/", @test) - 1)

Leave a Comment