
April 1st, 2005, 03:57 PM
|
|
Contributing User
|
|
Join Date: Feb 2005
Location: Near London
Posts: 112
  
Time spent in forums: 14 h 37 m 29 sec
Reputation Power: 5
|
|
Can't get the OUTPUT from my sp!
Hi, I'm a novice at writing stored procedures and I can't see why this won't work. I get the following error message when I call the sp below
Must pass parameter number 3 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'.
I'd really appreciate a bit of help as I am really stuck.
Iain
Code:
CREATE PROCEDURE dbo.uspInsertPersonalInvoice
(
@ClientID smallint = 6,
@InvoiceTotal smallmoney,
@TheScope int OUTPUT
)
AS
SET NOCOUNT ON
INSERT INTO dbo.Personal_Invoice
(DateCreated, ClientID, InvoiceTotal, DateSent)
VALUES
(GETDATE(), @ClientID, @InvoiceTotal, GETDATE())
SET @TheScope = SCOPE_IDENTITY()
SET NOCOUNT OFF
and to call it
Code:
DECLARE @TheID int
exec dbo.uspInsertPersonalInvoice
@ClientID = 6
, @InvoiceTotal = 257.96
, @TheID OUTPUT
SELECT @TheID
|