output i asp fra stored procedure.
Jeg har en stored procedure som skal leveret et output, jeg kan anvende i min asp kode.Min Stored procedure:
CREATE PROCEDURE dbo.sp_votekonkurrence
@BID int,
@SID int,
@msg varchar(255) output
AS
BEGIN
if((select count(*) as antal from ratings where BID =@BID)<5)
BEGIN
insert into ratings (BID,nummer) values (@BID,@SID)
SET @msg=1
END
ELSE
BEGIN
SET @msg=2
END
end
GO
Min asp kald til proceduren:
sql = "EXECUTE sp_votefotokonkurrence "&id&", "&nummer&""
DB.Execute(sql)
----------------------
Hvordan får jeg hentet @msg ud? f.eks. til en
dim variabel
variabel = [@msg]