Read contents of a text file into a varchar WITHOUT using BULK
问题 I've got a problem whereby I need to read data from a .txt file into a variable in SQL Server. The read needs to be performed programmatically, as it's going to form part of a stored procedure, and it needs not to utilise the BULK method, as I don't have permissions to use the BULK method on the database in question. Is this possible? Thanks in advance :) 回答1: Can you get them to allow Ad Hoc Distributed Queries? Then you can use OpenRowset or OpenDatasource. SELECT * FROM OPENROWSET('MSDASQL