Discussion Locked

Stored procedures in SQL Query Analyzer

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do I see an output total when I run a stored procedure in SQL Query Analyzer. The procedure sums an amount field into an OUTPUT field but when I run it in the Query Analyzer I dodn't see the result.

3 replies

by michaeltan

If i'm not misunderstand you... you can try below stmt

--------------------
use Northwind
go

CREATE PROCEDURE Northwind_Order_Sum @OrderID char(6) AS
SET NOCOUNT ON
BEGIN
select sum(unitPrice*quantity) as Total from [order details] where OrderID=@OrderID
group by OrderID
END

-------------------------
exec Northwind_Order_Sum 10248

This discussion is closed to new replies.