----
I typically use a ssis package with a credential (previous blog) to do this, but my friend does it this way .. well, he is testing it.
He is having trouble initiating with a schema.ini file..
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE with
override
GO
IF OBJECT_ID('#MyTable') IS NOT NULL
BEGIN
DROP TABLE
#MyTable
END
SELECT *
INTO #MyTable
FROM
OPENDATASOURCE(
'Microsoft.Jet.OLEDB.4.0'
,'Data
Source="C:\Event_Leads\G2WAttendee_02125312";Extended
Properties="text;HDR=No;FMT=Delimited";'
)...[G2WAttendee#csv]
Select *
from #MyTable
DROP TABLE #MyTable
EXEC sp_configure 'Ad Hoc Distributed
Queries', 0
GO
RECONFIGURE with override
GO
EXEC sp_configure 'show
advanced options', 0
GO
RECONFIGURE
GO