[AccessD] SQL Server 2005 - Getting back the records affected

jwcolby jwcolby at colbyconsulting.com
Thu Aug 6 07:13:10 CDT 2009


Phillippe,

Unfortunately with a search engine the results depend entirely on what you put in.  I was trying 
record count, records effected etc. and getting a million hits... about other stuff.  Finally I 
posted the question and (of course) immediately got an answer from Google.

I don't ask questions from AccessD to get an answer, I ask to force Google to give me an answer. 
Works every time.

;)

John W. Colby
www.ColbyConsulting.com


philippe pons wrote:
> Hi John,
> 
> you have a lazy google!
> Here is what I just find:
> ==================================================
> If you are running a stored procedure and it is not returning this
> information then when the procedure was written the SET NOCOUNT ON flag was
> set. This tells the server to not return this information back to the
> client.
> 
> If you are running a standard query in the Query Analyzer or Management
> Studio and you aren't getting the information back, it's because the SET
> NOCOUNT ON flag has been set, either on your client as a default, or on the
> server as a default. You can change this by putting SET NOCOUNT OFF in your
> query above the statement that you want to see the rowcount for.
> 
> You can also request after running your query the value of the @@ROWCOUNT
> variable and return this information.
> 
> UPDATE YourTable
>      SET Column = 'YourValue'
>  WHERE AnotherColumn = 3
> 
>  SELECT @@ROWCOUNT
> 
> =====================================================
> Hope this helps!
> Philippe




More information about the AccessD mailing list