Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Re: Can @@ROWCOUNT return NULL?
Try removing
SET NOCOUNT ON
from the stored procedure.


GeoSynch


"Dimitri Furman" <dfurman@cloud99.net> wrote in message
 news:Xns96C19F85E9F5
6dfurmancloud99@127.0.0.1...
> 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 t
o
> 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 b
e
> 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 int
o
> table variables, all other queries in the SP are SELECTs.
>
> Any related information would be appreciated.
>
> --
> remove a 9 to reply by email



Report this thread to moderator Post Follow-up to this message
Old Post
GeoSynch
08-30-05 08:25 AM


Re: Can @@ROWCOUNT return NULL?
GeoSynch  (SpamSlayed@Casablan
ca.com)  writes:
> Try removing
> SET NOCOUNT ON
> from the stored procedure.

@@rowcount should always return a value even if NOCOUNT is on. This
option controls whether rowcount information is passed to the client.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp


Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
08-30-05 12:24 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:58 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006