sql语句查询txt 文件

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
GO

select * from openrowset('MICROSOFT.JET.OLEDB.4.0','Text;HDR=Yes;DATABASE=E:\1\Data\',[heze#txt])
where SuoID=374170210


同目录下配置:schema.ini

[heze.txt]
ColNameHeader=False
format=Delimited( )
DatetimeFormat=DD.MM.YY
CharacterSet = ANSI
col1=SuoID TEXT WIDTH 10
col2=SuoName TEXT WIDTH 100
col3=CusID TEXT WIDTH 10
col4=BiaoID TEXT WIDTH 10
col5=Cun TEXT WIDTH 200
col6=UserName TEXT WIDTH 200
col7=UserID TEXT WIDTH 20

你可能感兴趣的:(sql)