AlwaysWilling
Programmer
Hi everyone, I am creating a stored proc like this:
And I get get a successful message like: The command(s) completed successfully..
Now, how can I insert values using this sp?
I tried this but didn't work:
And I get an error like Server: Msg 208, Level 16, State 3, Procedure sp_insert_orderDetails, Line 10
Invalid object name 'sp_insert_orderDetails'.
What am I doing wrong?
Code:
use northwind
GO
create procedure sp_insert_orderDetails
@OrderID int,
@ProductID int,
@UnitPrice smallmoney,
@Quantity smallint,
@Discount real
as
insert into sp_insert_orderDetails (OrderID, ProductID, UnitPrice, Quantity, DiscountValue)
values (@OrderID, @ProductID, @UnitPrice, @Quantity, @Discount)
And I get get a successful message like: The command(s) completed successfully..
Now, how can I insert values using this sp?
I tried this but didn't work:
Code:
use northwind
GO
create procedure sp_insert_orderDetails
@OrderID int,
@ProductID int,
@UnitPrice smallmoney,
@Quantity smallint,
@Discount real
as
insert into sp_insert_orderDetails (OrderID, ProductID, UnitPrice, Quantity, DiscountValue)
values (@OrderID, @ProductID, @UnitPrice, @Quantity, @Discount)
GO
sp_insert_orderDetails @OrderID= '10245', @ProductID= '2', @UnitPrice= $123123.45, @Quantity = '20', @Discount= '.25'
GO
And I get an error like Server: Msg 208, Level 16, State 3, Procedure sp_insert_orderDetails, Line 10
Invalid object name 'sp_insert_orderDetails'.
What am I doing wrong?