This will exist if you've installed access or the database components
--Run these to enable the options
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
--Run one of these to import your file, depending on which driver you have installed
--or
SELECT * into MyTable FROM OPENROWSET ('MSDASQL', 'Driver={Microsoft Access Text Driver (*.txt, *.csv)};DBQ=C:\Filepath', 'SELECT * from [MyFile.csv]')
No comments:
Post a Comment