Hi, can anyone tell me why the following does not work? It falls over at the select statement (qData: Missing SQL property). If I comment out that line all is good. As far as I can see what I have done is identical to various examples on the net.
Thanks
David
Code:
CREATE PROCEDURE dbo.UpdateCardBalTest
@DebitAmount money,
@LastBranch nvarchar(10),
@LastUsed smalldatetime,
@SerialNo NVARCHAR(15)
AS
DECLARE @upd TABLE(bal money, LastUsed nvarchar(10))
UPDATE GiftCard
SET Balance = (Balance - @DebitAmount),
BranchLastUsed = @LastBranch,
LastUsed = @LastUsed,
Status =
CASE
WHEN (Balance - @DebitAmount) = 0 then 'C'
ELSE Status
END
OUTPUT Inserted.Balance, Inserted.BranchLastUsed into @upd
WHERE SerialNo = @SerialNo
SELECT * FROM @upd