Is there a script somewhere (or a tool I can use) to add set nocount on to all my stored procdures?

  • I have over 600 stored procedures that do not have nocount set on and I have been asked to do performance tuning on them to include setting nocount on. Rather than going in and doing that individually I was wondering if there was a better way.

  • Use the Script Database tool to build a create script for all procs in one document, search-and-replace "Create proc" with "Alter proc", add "Set Nocount On" at the beginning of each one (I can't think of an easy way to do that without pasting it once per), then run the script.

    Of course, test it in a dev database first.

    Should be pretty quick, even with 600 procs.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • murray50 (7/15/2008)


    I have over 600 stored procedures that do not have nocount set on and I have been asked to do performance tuning on them to include setting nocount on. Rather than going in and doing that individually I was wondering if there was a better way.

    Solution:

    http://blog.strictly-software.com/2009/03/system-views-stored-procedures-and-set.html

    gsc_dba

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply