|
楼主 |
发表于 2020-4-25 12:45:01
|
显示全部楼层
应该这样是对的了
CREATE PROCEDURE GetDisplayNameByBatchAttibuteValues
(
@ListItemValue varchar(8000),
@ListDisplayName varchar(8000) output
)
AS
begin
declare @str varchar(8000)
declare @tb table(a int)
while charindex(',',@ListItemValue )>0
begin
insert @tb values(cast(left(@ListItemValue,charindex(',',@ListItemValue )-1) as int))
set @ListItemValue = stuff(@ListItemValue ,1,charindex(',',@ListItemValue ),'')
end
insert @tb values(@ListItemValue)
set @str =''
select @str = @str +',' + ListDisplayName from ProductAttributeLookupListItems where ListItemValue in(select a from @tb)
set @ListDisplayName=stuff(@str,1,1,'')
end
GO
但是没有返回结果,很奇怪
|
|