如何从 SQL Server 表中导出文本数据?
我正在尝试使用 MS SQL Server 2005 导入/导出工具导出表,以便我可以将其导入到另一个数据库中进行存档。 其中一列是文本,因此如果我导出为逗号分隔,当我尝试将其导入存档表时,对于该字段中带有逗号的行,它无法正常工作。 我应该选择哪些选项来确保导入正常进行?
I am trying to use the MS SQL Server 2005 Import/Export tool to export a table so I can import it into another database for archival. One of the columns is text so if I export as comma-delimited, when I try to import it into the archive table, it doesn't work correctly for rows with commas in that field. What options should I choose to ensure my import will work correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一年多后,我现在有了一个满足数据导出需求的理想解决方案,这要归功于 https://stackoverflow.com/questions/20363/
非常快速且轻松地嵌入到代码中。
Over a year later, I now have an ideal solution to my data export needs, thanks to https://stackoverflow.com/questions/20363/
Very quick and easy to embed within code.
除非客户需要,否则我从不使用逗号分隔符。 尝试使用 | 作为分隔符。 如果需要,您还可以使用文本限定符。
I never use the comma delimter unless the client requires it. Try using | as a delimter. YOu can also use the text qualifier if need be.
使用引号作为文本限定符
文本限定符:
输入要使用的文本限定符。 例如,您可以指定每个文本列都用引号引起来。
Use quotes as text qualifier
Text qualifier:
Type the text qualifier to use. For example, you can specify that each text column be surrounded with quotation marks.