简体   繁体   English

将文本文件中的数据直接插入到sql表中

[英]Inserting data from a text file directly to an sql table

for example if i had a text file in the following format 例如,如果我有一个以下格式的文本文件

A
B
C
D
E
.
.
.

and an sql table calld table with column called letters 和一个名为letters列的sql表calld table

i want to insert each value in the text file to the column letters , is it possible to do this directly from SQL Server without using any other programming language? 我想将文本文件中的每个值插入到列letters ,是否可以直接从SQL Server执行此操作而不使用任何其他编程语言?

also is it possible to specify a seperator for the values like "/" or "#" ? 是否可以为"/""#"等值指定分隔符? in case the the text format was A/B/C/D or A#B#C#D ? 如果文本格式是A/B/C/DA#B#C#D

Yes, exactly. 对,就是这样。 Use BULK INSERT can resolve your issue. 使用BULK INSERT可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM