I make this command and it's true:
SELECT *
FROM OPENROWSET( 'Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;Database=\00.000.00.0000\Arquivos\TI\Arquivos2203408.xlsx;HDR=YES',
'SELECT * FROM [Rateio$]');
How can I put a variable in place of the '252203408.xlsx' file and that I can use openrowset normally?
NOTE: I want to know this to open several files in a directory.