Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 (5 row(s) affected)

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2009-02-22 : 08:42:06
hi,

is there possibility to get this message "(5 row(s) affected)" somehow into the query as a result?

i would need it, when making updates, to store this message in a table.

thank you,

best

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2009-02-22 : 09:48:34
i've just found the solution:


select
*
,@@rowcount as [number of rows affected]
from mytable


still looking for update and insert solution
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-02-22 : 11:57:49
quote:
Originally posted by slimt_slimt

i've just found the solution:


select
*
,@@rowcount as [number of rows affected]
from mytable


still looking for update and insert solution



You sure? I don't think so



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-23 : 03:14:03
quote:
Originally posted by slimt_slimt

i've just found the solution:


select
*
,@@rowcount as [number of rows affected]
from mytable


still looking for update and insert solution


Not reliable

It displays from the previous execution

select
top 10 *
,@@rowcount as [number of rows affected]
from mytable

select
top 20 *
,@@rowcount as [number of rows affected]
from mytable

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2009-02-23 : 14:31:21
Madhivanan: thank you for your explanation. i've figure it out :)
best
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-24 : 02:33:59
quote:
Originally posted by slimt_slimt

Madhivanan: thank you for your explanation. i've figure it out :)
best


You are welcome

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -