I'm new to SQL with a background in OOL type programming.
I've created the following query which successfully imports .CSV files into a table on SQL Management Studio. How would I go about importing multiple files? This would be quite straightforward using an OOL language, although I heard you have to read directories using cmd?
The working code is as following:
--Cihans Import for Holdings--
INSERT INTO Holdings1
SELECT * FROM OPENROWSET
('MSDASQL', 'Driver={Microsoft Access Text Driver (*.txt, *.csv)}
;DBQ=C:\Share\DataUploads\FundHoldings;','SELECT * FROM holdings.csv')
How would I go about looping/reading all files in a directory and importing data? We are given over 120 sheets a month, and I would like to import using the above. Or if anyone can recommend an alternative to this?