如何将管道分隔的文本文件数据导入SQLServer表 [英] How to import pipe delimited text file data to SQLServer table

查看:100
本文介绍了如何将管道分隔的文本文件数据导入SQLServer表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以以下模式将数据库表表示为文本文件:

I have database table represented as text file in the following pattern:

0|ALGERIA|0| haggle. carefully f|
1|ARGENTINA|1|al foxes promise|
2|BRAZIL|1|y alongside of the pendal |
3|CANADA|1|eas hang ironic, silent packages. |

我需要将此数据导入到SQL Server 2008数据库表中。我已经创建了具有与模式匹配的类型的表。

I need to import this data to a SQL Server 2008 database table. I have created the table with the types matching the schema.

如何将此数据导入到表中?

How to import this data to the table?

编辑:通过选择答案来解决。
注意将来遇到任何麻烦的人:数据类型需要转换。
参考: http:// /social.msdn.microsoft.com/Forums/zh-CN/sqlintegrationservices/thread/94399ff2-616c-44d5-972d-ca8623c8014e

Solved by following the answer selected. Note to anyone stumbling upon this in future: The datatype needs to be converted. Refer: http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/94399ff2-616c-44d5-972d-ca8623c8014e

推荐答案

您可以使用导入数据功能,方法是右键单击数据库,然后单击任务,然后单击导入数据。这将为您提供一个向导,您可以为文件指定定界符等,并在插入任何数据之前预览输出。

You could use the Import Data feature by right mouse clicking the database, and then clicking Tasks then Import Data. This will give you a wizard which you can specify the delimiters etc. for your file and preview the output before you've inserted any data.

这篇关于如何将管道分隔的文本文件数据导入SQLServer表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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