Property Value

Specific user-defined functions can be referenced by using this collection by specifying the name of the user-defined function. To add a new user-defined function to the collection, call the user-defined function constructor UserDefinedFunction.

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference the AdventureWorks2012 database.
Dim db As Database
db = srv.Databases("AdventureWorks2012")
'Display all the user defined functions in the database.
Dim udf As UserDefinedFunction
For Each udf In db.UserDefinedFunctions
Console.WriteLine(udf.Name)
Next