Hello to All !
I m working in VB.NET 2010 with SQL Server 2008.
I created a Stored Procedure with output parameter in my Database using SQL Server 2008 Management Studio
Like this ...
Create PROCEDURE sp_InventoryAnalysis_M(
@RecordNoItem INT,
@ItemName NVarChar(200) Out,
@NetStock Money Out
)
As
Begin
Select
@ItemName=tbl_Items.ItemName
From
tbl_Items
Where
tbl_Items.RecordNoItem=@RecordNoItem
Order By
tbl_Items.RecordNoItem
Select
@NetStock=SUM(tbl_Stock.ItemIn)-SUM(tbl_Stock.ItemOut)
From
tbl_Stock
Where
tbl_Stock.RecordNoCompany=@RecordNoItem
End
now i am trying to execute this procedure in sql server management studio like this ...
Execute sp_InventoryAnalysis_M 15
but it gives me the following error ...
Msg 201, Level 16, State 4, Procedure sp_InventoryAnalysis_M, Line 0
Procedure or function 'sp_InventoryAnalysis_M' expects parameter '@ItemName', which was not supplied.
can anyone identify where i made mistake ?
The second question is this i want to execute this procedure in my VB.NET application and get value from its output parameter and use assign it into a variable.
Thanks.