I am trying to return a file from the files collection in a stored procedure. I&#039;ve used the sp_oaCreate and sp_oaMethod system stored procs to drill to the files collection but the item enumeration of the files collection doesn&#039;t seem to be returning a file. Does anyone know the tsql syntax to use the for each enumeration with the sp_oa procs or does anyone know whats up with the files collection. the object browser says it&#039;s there, but it just returns an invalid procedure call or aurgument (in vb, no error in tsql).<BR><BR><BR><BR>DECLARE @err int<BR>DECLARE @FSO int<BR>DECLARE @Folder int<BR>DECLARE @Files int<BR>DECLARE @File int<BR>DECLARE @i int<BR>Set @i = 1 <BR><BR>DECLARE @property varchar(255)<BR>DECLARE @return varchar(255)<BR>DECLARE @src varchar(255), @desc varchar(255)<BR><BR>EXEC @err = sp_OACreate &#039;Scripting.FileSystemObject&#039;, @FSO OUT<BR>EXEC @err = sp_OAMethod @FSO, &#039;GetFolder&#039;, @Folder OUT, &#039;\yourfilesystemhere&#039;<BR>EXEC @err = sp_OAMethod @Folder, &#039;Files&#039;, @Files OUT<BR>EXEC @err = sp_OAGetProperty @Files, &#039;Count&#039;, @property OUT<BR><BR>WHILE @i &#060; @property <BR> BEGIN <BR> EXEC @err = sp_OAMethod @Files, &#039;Item&#039;, @File OUT, @i<BR> IF @err &#060;&#062; 0<BR> BEGIN<BR> EXEC sp_OAGetErrorInfo @FSO, @src OUT, @desc OUT <BR> SELECT err = convert( varbinary(4), @err ), Source = @src, Description = @desc<BR> RETURN<BR> END<BR> SELECT @i = @i + 1<BR> END <BR>