2
I do this command and I do it right:
SELECT *
FROM OPENROWSET( 'Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;Database=\\00.000.00.0000\Arquivos\TI\Arquivos\252203408.xlsx;HDR=YES',
'SELECT * FROM [Rateio$]');
How can I put a variable in place of the file '252203408.xlsx' and that I can use openrowset normally?
NOTE: I wish to know this to make this opening several files of a directory.
There is no way, except if you use dynamic SQL command.
– José Diz