展开全部
create procedure SplitString (@InputString nvarchar(1000) output,
@OutString nvarchar(1000) output)
as
declare @SourseString nvarchar(1000)
set @SourseString =@InputString
declare @Position int
Set @Position = charindex(',',@SourseString)
begin
if(@Position=0)
begin
set @OutString=@InputString
set @InputString=null
end
else
begin
set @OutString=substring(@InputString,1,(@Position-1))
set @InputString=substring(@SourseString,(@Position+1),(len(@SourseString)-@Position))
end
end
你的这个题目很模糊,不知道是截取那个啊?
给你个例子,你使用substring 截取即可;
@OutString nvarchar(1000) output)
as
declare @SourseString nvarchar(1000)
set @SourseString =@InputString
declare @Position int
Set @Position = charindex(',',@SourseString)
begin
if(@Position=0)
begin
set @OutString=@InputString
set @InputString=null
end
else
begin
set @OutString=substring(@InputString,1,(@Position-1))
set @InputString=substring(@SourseString,(@Position+1),(len(@SourseString)-@Position))
end
end
你的这个题目很模糊,不知道是截取那个啊?
给你个例子,你使用substring 截取即可;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询