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.
| Author |
Topic |
|
iamsmahd
Yak Posting Veteran
55 Posts |
Posted - 2006-05-23 : 05:31:15
|
| hi all.I would like to know that what is the other benefit of using "Set NoCount On" in our stored procedures except than when it's on it doesn't show number of records that have been affected by our stored procedures? I had a sp named "Mysp1". when I used it within my .asp page I saw that my recordset state is closed. then I used "set nocount on" and refreshed my .asp page and my recordset was open? but I don't understand why? do you know?sonia |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-05-23 : 06:03:58
|
| with SET NOCOUNT OFF the "informational" messages may upset your application, particularly in an SProc that may do several tasks, and each of them could send an "informational" message.You application will probably have to use some sort of NEXT_RECORDSET method to process each recordset - so if it isn't doing that, and is only expecting one recordset AND its getting all the Informational messages it probably is not "consuming" all the data being transmitted, and is thus leaving the recordset open.Kristen |
 |
|
|
iamsmahd
Yak Posting Veteran
55 Posts |
Posted - 2006-05-24 : 01:10:02
|
| kristen,thanks alot......but still It's not clear for me using "set nocount on/off" in Sproc.....because without it.....the sproc does what it has to do....sonia |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-05-24 : 01:31:11
|
| It makes no difference to what the Sproc does, only to whether it outputs informational messages in addition to any resultsets.Kristen |
 |
|
|
|
|
|