declare @S1 varchar(100) select @S1=Url from BudgetYingFu; select Substring(Url,CHARINDEX('docid',Url)+6,5) from BudgetYingFu; update BudgetYingFu set FlowID= Substring(Url,CHARINDEX('flowid',Url)+7,3)