Nel

Nel

  • NA
  • 716
  • 1.1m

How to check whether my procedure works well in sql

Aug 5 2011 3:20 AM
Hi,
here is my stored procedure, and I want to check it with exec whether it works well
use db1
go
alter PROCEDURE vnesiDok
 (
 @vp NVARCHAR(30),
 @imeprezime NVARCHAR(60),
 @valuta_kurs decimal(4,2),
 @valuta CHAR(3),
 @iznos decimal(10,3),
 @iznosden decimal(10,3),
 @datum DATETIME,
 @br_kas_izvod int,
 @br_pat_smetka nvarchar(60),
 @tip nvarchar(30),
 @brdok INT OUTPUT
 )
AS
 /* SET NOCOUNT ON */
 set @iznosden=0.0;

 INSERT INTO blagajna_jspturs
 (vp, imeprezime, valuta_kurs,valuta ,iznos, iznosden, datum, br_kas_izvod, br_pat_smetka, tip)
 VALUES
 (@vp, @imeprezime,@valuta_kurs, @valuta, @iznos, @iznos*@valuta_kurs,@datum, @br_kas_izvod,@br_pat_smetka, @tip);
 
 SELECT @brdok=@@IDENTITY
 
 RETURN
 

exec vnesiDok
@vp=sdfs,
@imeprezime=dfs,
@valuta_kurs=61.0,
@valuta=E,
@iznos=20.0,
@iznosden=1220.00,
@datum='2011-08-05',
@br_kas_izvod=1,
@br_pat_smetka=df,
@tip=rerf
select @brdok
go

when I run the exec I got an error as if brdok is not declared, and if I declare it before exec, it says it is already declared. Can anybody help me please what's wrong with my procedure?
Thanks in advance

Answers (7)