必需的存储过程,可以从.txt文件中获取输入 [英] Required store procedure which can take input from .txt file

查看:73
本文介绍了必需的存储过程,可以从.txt文件中获取输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hello


是否可以创建存储过程,该过程可以从某些文件中获取.txt文件的输入如果有可能,请分享我的剧本。


提前致谢。

解决方案

您可以为文本文件创建链接服务器 


EXEC master.dbo.sp_addlinkedserver @server = N'txtFILE',@ srvproduct = N'txtFLATFILE', 

@ provider = N'Microsoft.ACE.OLEDB.12.0', 

@ datasrc = N'D:\ data \',@ provstr = N'text'



然后访问数据:



SELECT * FROM txtFILE ...产品#txt


 

另见一些例子

https://www.sqlservercentral.com/Forums/Topic1207780-391-1.aspx


Hello

Is it possible to create store procedure which can take the inputs from .txt file which is available in some drive.If it is possible,please share me the script.

Thanks in advance.

解决方案

You can create a linked server to the text file 

EXEC master.dbo.sp_addlinkedserver @server = N'txtFILE', @srvproduct=N'txtFLATFILE', 
@provider=N'Microsoft.ACE.OLEDB.12.0', 
@datasrc=N'D:\data\', @provstr=N'text'

Then access the data:

SELECT * FROM txtFILE...Product#txt

Also see some example

https://www.sqlservercentral.com/Forums/Topic1207780-391-1.aspx


这篇关于必需的存储过程,可以从.txt文件中获取输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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