object_definition
システム関数を使用する必要があります
select specific_name, object_definition(object_id(specific_name))
from INFORMATION_SCHEMA.ROUTINES
where routine_type = 'FUNCTION'
更新:わかりましたので、それはあなたが望むものではありません. 標準のユーザー定義関数ではなく、CLR 関数の定義が必要であることを見逃していました。実際、私はあなたを助けることができるスクリプトのペアを持っています. CLR関数のパラメーターを取得して、必要なスクリプトを組み合わせることができます
select
O.[object_id] as System_Object_ID,
A.Name as Assembly_Name,
ASM.assembly_class as Assembly_Class,
ASM.assembly_method as Assembly_Method,
case
when ASM.execute_as_principal_id is null then 'CALLER'
else PR.name
end as Execute_As_Name
from sys.assembly_modules as ASM with (nolock)
inner join sys.assemblies as A with (nolock) on A.[assembly_id] = ASM.[assembly_id]
inner join sys.objects as O with (nolock) on O.[object_id] = ASM.[object_id]
left outer join sys.schemas as S with (nolock) on S.[schema_id] = O.[schema_id]
left outer join sys.database_principals as PR on PR.principal_id = ASM.execute_as_principal_id
select
O.[object_id] as System_Object_ID,
P.name as Parameter_Name,
T.name as [Type_Name],
P.precision as [Precision],
P.scale as [Scale],
P.max_length as [Max_Length],
case
when P.has_default_value = 1 then isnull(cast(P.default_value as nvarchar(max)), 'null')
else null
end as Default_Value,
P.is_output as Is_Output
from sys.assembly_modules as ASM with (nolock)
inner join sys.parameters as P with (nolock) on P.[object_id] = ASM.[object_id]
inner join sys.objects as O with (nolock) on O.[object_id] = ASM.[object_id]
left outer join sys.schemas as S with (nolock) on S.[schema_id] = O.[schema_id]
inner join sys.types as T with (nolock) on T.system_type_id = P.system_type_id and T.user_type_id = P.user_type_id
または、より簡単かもしれませんが、SSMS からそのオブジェクトをスクリプト化することができます :)