1 CREATE FUNCTION [dbo].[fn_parsejson] 2 3 (@p_jsonstr VARCHAR(8000), 4 @p_key VARCHAR(200)) 5 6 RETURNS VARCHAR(MAX) 7 AS 8 BEGIN 9 RETURN SUBSTRING(@p_jsonstr,CHARINDEX(‘"‘+@p_key+‘":‘,@p_jsonstr)+LEN(@p_key)+4,CHARINDEX(‘"‘, SUBSTRING(@p_jsonstr,CHARINDEX(@p_key,@p_jsonstr)+LEN(@p_key)+3,LEN(@p_jsonstr)))-1) 10 END
时间: 2024-10-18 15:32:24