Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Does SET NOCOUNT ON eliminate @@ROWCOUNT values after table inserts?

$
0
0

Hi All,

I'm troubleshooting numerous stored procedures.  I notice most of them have "SET NOCOUNT ON" at the top.  Later, in each sproc, we set a local variable = @@ROWCOUNT.  First I assumed the reason we were getting NULL local variable values was because of the SET NOCOUNT ON, but then I see the variable gets set correctly some days.  I must be misunderstanding SET NOCOUNT; apparently, @@ROWCOUNT works regardless of the SET NOCOUNT status.  Am I correct?

Some of the procedures use minimal logging for inserts.  Does minimal logging interfere with @@ROWCOUNT results?

Thanks,
Eric


Viewing all articles
Browse latest Browse all 23857

Trending Articles