how to test sp on QA

Results 1 to 2 of 2

Thread: how to test sp on QA

  1. #1
    Join Date
    Dec 1969

    Default how to test sp on QA

    CREATE PROC dbo.proc1(@para1int, @result int = 0 output )<BR>AS <BR><BR><BR><BR>SET NOCOUNT ON<BR><BR><BR>declare @cnt1<BR><BR>Select @cnt1 = (select count(*) from table1 where col1 is null and col2 = @para1)<BR> <BR><BR> <BR><BR>if @cnt1 &#062; 0<BR> begin<BR> select @result = 1 --errror<BR> <BR><BR> end<BR><BR>else<BR><BR>begin<BR> select @result = 0 --success<BR>end<BR><BR> select @result <BR><BR> GO<BR><BR>I want to test if @result is returning 1 or 0 <BR><BR>thanks!

  2. #2
    Join Date
    Dec 1969

    Default That should be working

    If you EXEC that query in query analyzed, you should get a display of one record, one column (with the column titled "no column name"), and either 1 or 0 in the cell for that record/column.<BR><BR>Oh, wait!<BR><BR>Maybe it&#039;s becuz you are doing SELECT of the output param.<BR><BR>Hmmm....<BR><BR>Try adding<BR> DECLARE @r INT<BR>and then as last step doing<BR> SELECT @r = @result<BR> SELECT @r<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts