Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 OPENDATASOURCE text file with .log extension

Author  Topic 

ryan.gillies
Starting Member

27 Posts

Posted - 2013-12-17 : 01:16:13
This an obscure one to which I feel there may be no answer, but here goes.

It would be very convenient for us if we could read into SQL Server our Filezilla Server log files. At first I thought this should be relatively simple, however its proving more troublesome than I thought - the primary reason being that the files have a .log extension rather than a .txt

If I change the file to a .txt, executing the following against it works:
SELECT     *  
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\Program Files\FileZilla Server\Logs\;
Extended Properties="Text; HDR=NO; FMT=Delimited(|)"')...[fzs-2013-12-16#txt]


However doing the same but with the original file fails:
SELECT     *  
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\Program Files\FileZilla Server\Logs\;
Extended Properties="Text; HDR=NO; FMT=Delimited(|)"')...[fzs-2013-12-16#log]


It returns the following error:
Msg 7314, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" does not contain the table "fzs-2013-12-16#log".
The table either does not exist or the current user does not have permissions on that table.


I've found next to nothing about different file extensions online, so I'm assuming I cannot use OPENDATASOURCE. Can anyone challenge that assumption or provide an alternative means of accessing a text file with a .log extension?
   

- Advertisement -