任何人请帮忙 我写了一个像这样的存储过程
ALTER PROCEDURE [dbo].[STP_SELECTED_BOX_NO_FOR_ADMIN]
-- Add the parameters for the stored procedure here
@list VARCHAR(500)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
DECLARE @pos int
--create table to hold parsed values
CREATE TABLE #list (val varchar(10))
--add comma to end of list
SET @list = @list + ','
--loop through list
WHILE CHARINDEX(',', @list) > 0
BEGIN
--get next comma position
SET @pos = CHARINDEX(',', @list)
--insert next value into table
INSERT #list VALUES (LTRIM(RTRIM(LEFT(@list, @pos - 1))))
--delete inserted value from list
SET @list = STUFF(@list, 1, @pos, '')
END
SELECT * FROM VIEW_BOX_NO_FOR_ADMIN
WHERE HoBoxNo IN (select val from #list)
ORDER BY HoBoxNo asc
END
当我将存储过程拖到我的dbml文件时,它将返回类型作为int并且始终返回0,但是我想要返回结果集,并且当我在sql server management studio中运行过程时它给出了正确的结果,< / p>
任何人请帮助