Add-UserDefinedFunction

Creates a new user-defined function.

Syntax

Add-UserDefinedFunction [-Name] <String> [-SchemaName <String>] [-Definition] <String> [<CommonParameters>]

Description

Creates a new user-defined function.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the stored procedure.

true false
SchemaName String

The schema name of the stored procedure. Defaults to dbo.

false false dbo
Definition String

The store procedure's definition. Everything after the create function [schema].[name] clause.

true false

EXAMPLE 1

Add-UserDefinedFunction -SchemaName 'rivet' 'One' 'returns tinyint begin return 1 end'

Creates a user-defined function that returns the number 1.