create function dbo.extractAfter(@full nvarchar(max), @part nvarchar(max))
returns nvarchar(max)
with returns null on null input
as begin
return ltrim(stuff(left(@full,charindex(' ', @full + ' ', charindex(@part,@full)+1)),
1, charindex(@part,@full)+datalength(@part)/2 -1, ''))
end
go