Home Forums Programming General Getting all the Functions in a DB and Re-Saving them. RE: Getting all the Functions in a DB and Re-Saving them.

  • It sounds like you might want this more automated, but if this is for occasional use you can script out all the functions by right clicking on the DB name in EM | All Tasks | Generate SQL Script |Show all |check the box for All User Defined Functions.  Then click the Options tab and check Script Object Level Permissions, then click OK.

    Finally, run the script.

    If you want to fully automate this you could perhaps create something using a version of ForEach using Brian Knight's example in:

    http://www.sqlservercentral.com/columnists/bknight/sp_msforeachworker.asp , to loop through the functions/function text.

    Bill