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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 prevent outputs in your queries for performance

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2007-05-07 : 15:23:54
Hi,

I am forgetting the statement you can add to your stored procedures to prevent sql server from sending messages after your query runs.

For example, if you are running a update query and you don't need any feedback, you can do something like:

SET _____ OFF

or somethint like that, and from what I understood sql server won't print statments like "1 row(s) affected".

Does anyone know what i'm talking about?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-07 : 15:30:11
SET NOCOUNT ON

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-05-07 : 15:31:36
NOCOUNT??

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2007-05-07 : 15:55:54
yeah that's it, thanks hehe.
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-07 : 16:40:49
you should set it to ON to suppress the information being seint across, not to OFF.

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-07 : 16:53:48
That's what I said already.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-07 : 17:00:52
Hi Tara
I understand you said it already, but I just wanted to stress on the ON because the OP initially had an OFF in his query and its very easy to overlook the ON/OFF thing as the OP was only looking for the keyword NOCOUNT.

I am definetely not trying to bump my postcount

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-05-08 : 11:47:13
quote:
I am definetely not trying to bump my postcount

I, however, am.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -