August 8, 2012 at 10:32 pm
Hi,
I have stored procedure having one input parameter .
ALTER PROCEDURE [dbo].[CMT_RoomDelete]
@pRoomId INT,
AS
BEGIN
UPDATE CMT_Rooms SET IsActive = 0 WHERE RoomID = @pRoomId
END
I want to get the input parameter value for @pRoomId inside the SP. I can simply get using select @pRoomId. But my requirement is different.I am using this following sql statement
select name from sys.parameters where object_id in (select object_id from sys.procedures where name = 'CMT_RoomDelete')
But this will return only @pRoomId. I want to get the value for this ouput (@pRoomId).
Pls help me to find out it.
August 9, 2012 at 12:50 am
Could you please clarify your question? What do you mean by "get" parameter? Get for what purpose?
If you want to display it for debug purpose you may use "print(@myParam)", or "select @myParam".
If you want to use it in some statements - just use it, as it is written in your code "...where myField=@myParam..."
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply