T-SQL - Read CSV files using OpenRowSet
T-SQL – Read CSV files using OpenRowSet
We can directly access a CSV file using T-SQL.
Input file
Configure server to run Ad Hoc Distributed Queries
sp_configure 'Ad Hoc Distributed Queries',1 GO reconfigure GO
Check for Microsoft Access Driver on your system
SQL
select [hour], UserID, [ReportLaunch] from openrowset('MSDASQL' ,'Driver={Microsoft Access Text Driver (*.txt, *.csv)}' ,'select * from C:\blog\input.CSV') OR select…
View On WordPress











