Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read in a text file from a stored procedure

I need to read in a log file created by a SSIS package in my stored procedure.

Is there a good way to do this?

I tried using this code but it shows the contents of my file as jibberish. Is there some kind of encoding issue it's not handling? Is there an easier way?

like image 729
Greg Avatar asked Nov 20 '25 21:11

Greg


1 Answers

Have you tried a straight bulk insert? For example:

create table #TempTable (line varchar(256))
bulk insert #TempTable from 'c:\logfile.txt'
like image 130
Andomar Avatar answered Nov 22 '25 15:11

Andomar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!