Are you running into any issues when using charindex and substring? In any case, the following does not use either of those functions:DECLARE @x VARCHAR(256) = 'http://www.mysite.com/Default.aspx?TabId=330&EntryId=1';
SELECT STUFF(@x,1,PATINDEX('%&EntryId%',@x),'')