Foretog nogle undersøgelser og fandt en måde at loope over filerne ved at bruge noget som dette:
CREATE TABLE #tmp(excelFileName VARCHAR(100));
INSERT INTO #tmp
EXEC xp_cmdshell 'dir /B c:\my\folder\path\';
declare @fileName varchar(100)
While (Select Count(*) From #tmp where excelFileName is not null) > 0
Begin
Select Top 1 @fileName = excelFileName From #tmp
-- OPENROWSET processing goes here, using @fileName to identify which file to use
Delete from #tmp Where excelFileName = @FileName
End
DROP TABLE #tmp