Remove 'x rows affected…..' from store procedure | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Remove ‘x rows affected…..’ from store procedure


Hi, i use below code to send an email to all user to tell them how many hour they are
spenting per day, query success to run but when i received the mail, it also include
‘x rows affected…..’ as below, how can i remove it ??? FYI, i use store procedure to create a #temp table and insert some record inside and
return a record set. In my send email query, i call this store procedure. I try to set nocount on, result still the same.
output in email : (0 rows affected) (1 rows affected) (1 rows affected) (1 rows affected) (1 rows affected)
Item 2007-03-21 2007-03-22 2007-03-23 2007-03-24 2007-03-25 2007-03-26 2007-03-27 2007-03-28
———- ———- ———- ———- ———- ———- ———- ———- ———-
WeekDay Wed Thu Fri Sat Sun Mon Tue Wed
UserA 1:25 51:11 6:24 7:11 4:56
UserB 3:54 19:40 5:13 22:11 5:54 3:59
UserC 0:01 19:49 0:05 2:04 3:06 (4 rows affected)
Where did you put in the SET NOCOUNT ON?
It should be the very first statement right after the CREATE PROCEDURE…. AS —
Frank Kalis
Moderator
Microsoft SQL Server MVP
Webmaster:http://www.insidesql.de
i put it before create procedure <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><br />thanks for your help.
]]>