A SQL Server Blog

SSIS: Lookup from Text Files

Ever want to do a lookup on a text file without putting it in a database or using a merge join?

Grant from the Project REAL team found a great nugget:

Openrowset now allows the BULK clause to be specified which accepts a filename and format specification. An OLE-DB driver for flat-files or XML would also do the job but this is a nice work-around for the native stack. The only difficulty is getting your head around the format for the .fmt file but after that it 'just works':

    select *
    from openrowset(bulk N'c:\temp\test.txt', formatfile = 'c:\temp\test.fmt') as x

thanks, Grant!

 

Published Monday, October 24, 2005 12:33 PM by Ashvini Sharma [MSFT]

Comments

 

roy ashbrook said:

snipped from here . Openrowset now allows the BULK clause to be specified which accepts a filename and

May 4, 2007 7:36 PM
 

A SQL Server Blog SSIS Lookup from Text Files | Paid Surveys said:

June 2, 2009 3:09 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker