Get-SqlUserDefinedFunction

Gets an SMO UserDefinedFunction object.

Syntax

Get-SqlUserDefinedFunction [-database] <Database> [[-name] <String>] [<CommonParameters>]

Detailed Description

The Get-SqlUserDefinedFunction function gets a collection of SMO UserDefinedFunction objects for the specified database.

Related Commands

* Get-SqlUserDefinedFunction

Parameters

Name Description Required? Pipeline Input Default Value
database    true  true (ByValue)   
name    false  false   

Input Type

Microsoft.SqlServer.Management.Smo.Database You can pipe SMO database objects to Get-SqlUserDefinedFunction

Return Values

Microsoft.SqlServer.Management.Smo.UserDefinedFunction Get-SqlUserDefinedFunction returns a Microsoft.SqlServer.Management.Smo.UserDefinedFunction object.

Notes

Additional properties including the database, server and extended properties are included in the output.

Examples

EXAMPLE 1

Get-SqlUserDefinedFunction $(Get-SqlDatabase "Z002\sql2K8" AdventureWorks)
This command gets a collection of SMO UserDefinedFunction objects for SQL Server Z002\SQL2K8, AdventureWorks database.

EXAMPLE 2

Get-SqlDatabase "Z002\sql2K8" | Get-SqlUserDefinedFunction
This command gets a collection of SMO UserDefinedFunction objects for all user databases on SQL Server Z002\SQL2K8.

EXAMPLE 3

Get-SqlDatabase "Z002\sql2K8" AdventureWorks | Get-SqlUserDefinedFunction -name "ufnGetAccountingEndDate"
This command gets an SMO UserDefinedFunction object for the ufnGetAccountingEndDate user defined function in the AdventureWorks database on SQL Server Z002\SQL2K8.