1
Answer

How to create stored procedure with parameter in sql server database

Nikos Rizos

Nikos Rizos

13y
2k
1
Hi,

How to create stored procedure with parameter in sql server 2008 ?
Answers (1)
0
Arul Selvan

Arul Selvan

NA 26 43.4k 13y
here i show for select paticular employee details based on id
i passed id as a parameter like that you can pass parameter for stored procedure

if you want to pass more than one parameter use ,

like @id INT,@name varchar(20)



CREATE PROCEDURE pro_GetEmployee
@id INT
AS
BEGIN
    SELECT * FROM tbl_emp WHERE empid=@id
END
GO

EXEC pro_GetEmployee 10001



Stored procedure  parameter are to be two type IN and OUT
the default is IN as we did earlier example not necessary to mention.


The OUT parameter used for return value from stored procedure