December 2001
Intermediate to advanced
800 pages
17h 55m
English
Transact-SQL provides a handful of OBJECTPROPERTY() options for retrieving info about UDFs. They allow you to determine the specific type of UDF as well as whether a function is deterministic and/or schema bound. Table 10-1 summarizes these options:
Here's a query that demonstrates how these are used (Listing 10-6):
SELECT LEFT(name,20) AS [Function],
OBJECTPROPERTY(id,'IsScalarFunction') AS Scalar,
OBJECTPROPERTY(id,'IsTableFunction') AS [Table],
OBJECTPROPERTY(id,'IsInlineFunction') AS Inline,
OBJECTPROPERTY(id,'IsDeterministic') AS Determ,
OBJECTPROPERTY(id,'IsSchemaBound') AS SchemaBound
FROM sysobjects
WHERE type in ('IF','TF','FN')
ORDER BY name
|
(Results)
Function ...
Read now
Unlock full access