Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: @@error vs @@rowcount

    it seems cant get correct @@error & @@rowcount as the same time. pls advise how to get both value after a sql statement executed.
    e.g
    case 1
    select name from sysobjects where name like "sysc%"
    select a=@@error
    select b=@@rowcount
    ---
    name
    ----
    syscolumns
    syscomments
    sysconstraints

    a
    -----------
    0
    b
    -----------
    1 (should be 3 but it seems referring output from @@error)

  2. #2
    Join Date
    Feb 2007
    Location
    Chennai, TN
    Posts
    68
    you can use as

    declare @a int, @b int
    select name from sysobjects where name like 'sysc%'
    select @b = @@error,@a = @@rowcount
    print @a
    print @b

  3. #3
    Join Date
    Jul 2006
    Posts
    115
    oh yes, thx for your remind..

Posting Permissions

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