如何从存储过程读入文本文件 [英] How to read in a text file from a stored procedure

查看:50
本文介绍了如何从存储过程读入文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要读入由我的存储过程中的 SSIS 包创建的日志文件.

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

有什么好的办法吗?

我尝试使用 此代码 但它显示我的文件内容为乱码.是否存在某种编码问题无法处理?有没有更简单的方法?

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?

推荐答案

您是否尝试过直接批量插入?例如:

Have you tried a straight bulk insert? For example:

create table #TempTable (line varchar(256))
bulk insert #TempTable from 'c:\logfile.txt'

这篇关于如何从存储过程读入文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆