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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to get a list of UDF's?

Author  Topic 

toddhd
Yak Posting Veteran

55 Posts

Posted - 2005-07-14 : 15:42:59
I found that I can get a list of all tables in a given database by using:
sp_tables

And I can get all views by using:
sp_tables @table_type='VIEW'

How do I pull up a list of all UDF's in a Database?

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2005-07-14 : 15:49:10
[code]
select * from information_schema.routines
where routine_type = 'FUNCTION'[/code]
Go to Top of Page

toddhd
Yak Posting Veteran

55 Posts

Posted - 2005-07-14 : 15:56:24
Thanks! That works great! (That's also a cool way to get a lost of sprocs, I see)

While I'm here, I just realized that my attempt to list views does not work as expected - how can I list those?
Go to Top of Page

toddhd
Yak Posting Veteran

55 Posts

Posted - 2005-07-14 : 15:57:12
Never mind, I got it:
select * from information_schema.views
Go to Top of Page

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2005-07-14 : 15:58:42
The information_schema tables can be used to find just about all of the meta data.

select * from information_schema.view_table_usage
select * from information_schema.views

Have a look at information_schema in BOL
Go to Top of Page
   

- Advertisement -