In Azure Data Factory, when you execute a query or stored procedure, the query or stored procedure can return one or more result sets.
A result set is a table of data returned by a query or stored procedure. In the case of one result set, the query or stored procedure returns one table of data. In the case of multiple result sets, the query or stored procedure returns multiple tables of data.
When you are working with one result set, you can access the data by using the first index of the result set array, for example, resultSet[0].
When you are working with multiple result sets, you need to access each result set by its index, for example, resultSet[0], resultSet[1], etc.
It's important to note that when you are using a stored procedure, you need to check how many result sets are returned by that procedure, and handle them accordingly in your pipeline.
In Azure Data Factory, the Execute SQL task is used to execute queries and stored procedures, and it supports both one result set and multiple result sets. The output of this task can be used as an input to other tasks in the pipeline, such as the Copy Data task, to further process the data.
It's important to mention that not all Data sources support multiple result sets, so when you are working with those sources, the result sets returned will always be one.