Re: Can @@ROWCOUNT return NULL?



Try removing
SET NOCOUNT ON
from the stored procedure.


GeoSynch


"Dimitri Furman" <dfurman@xxxxxxxxxxx> wrote in message
news:Xns96C19F85E9F56dfurmancloud99@xxxxxxxxxxxx
> SQL Server 2000 SP3.
>
> Is it possible for the @@ROWCOUNT function to return NULL after a
> statement? I am troubleshooting a relatively large stored procedure with
> multiple SELECT statements and a couple of INSERTs into table variables.
> Immediately after each statement I save the value returned by @@ROWCOUNT to
> a local variable. That information eventually is passed back to the client
> via one output parameter, for all statements in the procedure.
> Occasionally, the value returned via that parameter is NULL. This cannot be
> reproduced by re-running the SP with the same input parameters.
>
> Before doing any further troubleshooting, I would like to rule out the
> possibility that @@ROWCOUNT can actually return a NULL under some
> circumstances. From searching the archives, it appears that in SQL Server
> 7.0 this could happen in the context of a DML query on a table with
> triggers. This is not the case here - the only DML queries are INSERTs into
> table variables, all other queries in the SP are SELECTs.
>
> Any related information would be appreciated.
>
> --
> remove a 9 to reply by email


.



Relevant Pages

  • Can @@ROWCOUNT return NULL?
    ... I am troubleshooting a relatively large stored procedure with ... Immediately after each statement I save the value returned by @@ROWCOUNT to ... Before doing any further troubleshooting, I would like to rule out the ... it appears that in SQL Server ...
    (comp.databases.ms-sqlserver)
  • Re: Stored procedure question
    ... comparison(in case u haven't configured you sql server) ... > You could capture the rowcount after this, ... > Vyas, MVP ... > I need to write a stored procedure which changes user password based on ...
    (microsoft.public.sqlserver.programming)
  • Re: Can @@ROWCOUNT return NULL?
    ... I am troubleshooting a relatively large stored procedure with ... > Immediately after each statement I save the value returned by @@ROWCOUNT ... > Before doing any further troubleshooting, I would like to rule out the ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)
  • Re: Accessing FoxPro Free Table
    ... which the SQL Server service is running. ... account, ... > If you are creating a stored procedure and you want> to make sure that the procedure definition cannot be> viewed by other users, you can use the WITH ENCRYPTION> clause. ... The procedure definition is then stored in an> unreadable form. ...
    (microsoft.public.data.odbc)