Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Calling SP NOT returning results

Author  Topic 

jesus4u
Posting Yak Master

204 Posts

Posted - 2002-08-23 : 10:39:03
I am calling a SP from within another SP and using this statement to ge the RoleID into the variable. When I debug it doens't return the RoleID. The code is going into the called SP.

SELECT @RoleID as RoleID exec dbo.db_GetUserRole @ChatRoomId , @Uid



jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-23 : 13:26:41
exec dbo.db_GetUserRole @ChatRoomId , @Uid, @RoleID = @RoleID OUTPUT


HTH
Jasper Smith
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-08-24 : 17:57:36
And the called sp has to be declared as

create procedure db_GetUserRole
@ChatRoomId int ,
@UID int ,
@RoleID int output
as

you don't need the identifier on the call
exec dbo.db_GetUserRole @ChatRoomId , @Uid, @RoleID output
will do.

If you are trying to return the RoleID as a return code (not a good idea) then
exex @RoleID = exec db_GetUserRole @ChatRoomId , @Uid

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -