Nasir
Nasir

Reputation: 167

How to call TVF that returns multiple rowsets in U-SQL

U-SQL TVF can also return multiple rowsets, I can create such function successfully but unable to call such function with error:

Severity Code Description Project File Line Suppression State Error E_CSC_USER_MULTIPLERESULTFUNCTIONNOTALLOWED: Multiple-result function call is not allowed in this context. Description: Multiple-result return values must be assigned to a list of rowset variables. Resolution: Add a separate statement that calls the multiple-result function and assigns the results to a list of rowset variables.

Thanks, Nasir

Upvotes: 2

Views: 198

Answers (1)

Michael Rys
Michael Rys

Reputation: 6684

(@r1, @r2) = TVFreturning2rowsets();

Then you can select from them individually:

@x = SELECT * FROM @r1 ...;
@y = SELECT * FROM @r2 ...;

Upvotes: 2

Related Questions