If the element type is a UDT, then UDT handles are returned in the returnValue buffer for each UDT element retrieved. No more than 2000 UDT handles may be allocated during the execution of any UDF, UDM, or external stored procedure. Therefore, no more than 2000 UDT elements may be retrieved in any call to FNC_GetArrayElements, and if other FNC calls in your routine also allocate UDT handles, this limit will be even lower.