Getting all the Functions in a DB and Re-Saving them.

  • I'm not sure how possible this is; but I thought I'd throw a feeler out there anyway.

    Does anyone know of a way to programatically roll through all the functions in a database and re-save them?

    Thanks in advance for your help.

    Mike

  • What are you trying to accomplish and then we may be able to help better...



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • 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

  • Bill,

    Thanks.

    Brian Knight's example was exactly what I was looking for; I'll just have to figure out how to extend it to re-save each of the functions.

     

    Mike

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

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