Where are user defined functions stored in MS SQL Server 2008?

16,598

In SQL Server Management Studio (SSMS) look under the Programmability\Functions branch.

enter image description here

Since you asked, here is how to do it in SQL, not that it will help you if you don't have permissions.

EXEC sp_HelpText 'someUserDefinedFunction'
Share:
16,598
Skylude
Author by

Skylude

Updated on July 29, 2022

Comments

  • Skylude
    Skylude almost 2 years

    I want to be able to see the code associated with the User Defined Function. I can see the name etc by doing the following,

    select * from information_schema.routines where routine_type='function'
    

    Which is all fine and dandy but I can actually see the code. Do I need to do this in SQL Server Management Studio, and if so how?

    Thanks for all the help, I'm a noob when it comes to IIS/MS SQL stuff.

  • Skylude
    Skylude over 12 years
    I've looked here and I see no User Defined functions under any of those folders.
  • Skylude
    Skylude over 12 years
    Oh I forgot to mention as well, I may be missing permissions -- if they are guarded by permissions not pertaining to the DB. I have full permissions on the DB but if the defined functions are outside the DB I may have problems. Is there anyway to get the code via an SQL query?
  • user3001801
    user3001801 over 12 years
    If you don't have permissions you aren't going to be able to circumvent them just by using a query.