July 22, 2010 at 1:07 pm
Hi,
How can i write the store procedure which takes input parameter?
SELECT RM.RName, RM.Logo, MST.PUrl, RM.HPUrl
FROM MST INNER JOIN
RM ON MST.DId = RM.DId AND MST.STid = RM.STid
WHERE (MST.DId = 32) AND (MST.PID = '1G16') AND (RM.Flag = 'True')
ORDER BY RM.Rank
I need to pass MST.DId = 32 AND MST.PID = '1G16' both as an Input variables
Thanks for oyur help!
July 22, 2010 at 1:14 pm
yes, you should look in Books OnLine
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 22, 2010 at 2:16 pm
Pretty basic stuff. Here's a basic answer...
CREATE PROCEDURE MyProc
(@DId int,
@PID varchar(20) )
AS
SELECT RM.RName, RM.Logo, MST.PUrl, RM.HPUrl
FROM MST INNER JOIN
RM ON MST.DId = RM.DId AND MST.STid = RM.STid
WHERE (MST.DId = @DId) AND (MST.PID = @PID) AND (RM.Flag = 'True')
ORDER BY RM.Rank
Then EXEC as
EXEC MyProc 16, '1G16'
Rob Schripsema
Propack, Inc.
July 22, 2010 at 9:10 pm
Thank you very much!
I got it the same way but really appreciate your help!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply