You can create a batch statement from it, and then EXEC it
DECLARE @sql nvarchar(max) SELECT @sql = coalesce(@sql + ';', '') + 'exec sprocname ' + QuoteName(AField, '''') FROM Table WHERE AField2 = 'SomeIdentifier' AND AField is not null EXEC (@sql)
Before editing (on TVF), you could change the SP to continue filling out the pace table.
After editing in TVF, you can use the cross:
SELECT F.* FROM Tbl CROSS APPLY dbo.TVFName(Tbl.AField) F WHERE Tbl.AField2 = 'SomeIdentifier'
Which returns all the "table results" from each call to Tbl.AField in a single result set
source share