I am new to sql server and learning store procedure
i m creating store procedure for fetching data of perticuler ID
as follow
- CREATE PROCEDURE SelectByID @ID INT
- AS
- BEGIN
- SELECT *
- FROM EmployeeDetails
- WHERE EmployeeID = @ID
- RETURN
- END
- GO;
Exec SelectByID ID = "4";
Please help me out it is showing error like "Incorrect Syntax near '=' ".
Yogesh GhorpadePosted Jul 6, 2018, 1:17 AM
Jignesh KumarPosted Jul 6, 2018, 1:40 AM
Hi Snehal,
We need to execute store procedure with @ID = 4 or direct parameter value base on data type. you can try below two ways of executing procedure
Exec SelectByID @Id = 4
Exec SelectByID 4
snehal suryavanshiPosted Jul 6, 2018, 1:09 AM
Sanwar RanwaPosted Jul 6, 2018, 1:08 AM
Ramesh PalanivelPosted Jul 6, 2018, 1:06 AM