Yes you can do this. You can use <a href=”http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1270919_mem1,00.html”>xp_dirtree</a> to get a list of files in a folder and drop the returned recordset into a table then loop through the rows in the table processing the filenames.
Hi, not to put too fine of a point on this but I would disagree with this answer. The question is can one use SQL to access a PC directory structure. SQL can only access RDBMS data. The suggested approach is not truly using SQL; where SQL consists of SELECT, CREATE, REVOKE, etc.