迎加入技术交流QQ群80669150 (附加信息:珠海 -"Lzw )一起学习 !




CREATE FUNCTION Split(@inputStr nvarchar(800),@logo nvarchar(800))
returns nvarchar(800)
AS


BEGIN
--set @inputStr='klsjaff_sdfla_sdfla'
--select CHARINDEX('_',@inputStr)




return Substring (@inputStr,1,CHARINDEX(@logo,@inputStr)-1)


END


--select dbo.Split('klsjaff_sdfla_sdfla','_')