when i drag and drop a procedure in dbml it shows returntype as none
Any one please help I have written a stored pocedure like this
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 o开发者_如何学JAVAf 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
when i drag stored procedure to my dbml file it gives return type as int and returns 0 all time, but i want result set to be returned, and when i run procedure in sql server management studio it gives me correct results,
any one please help
You need to return your result. Take a look at this answer for a simple example.
精彩评论