使用 BCP 从 SQL Server 表写入文件
我刚刚意识到我在 SQL Server 中的工作已经结束了,哈哈。
无论如何,我尝试使用 bcp 从
serverName.databaseName.databaseInstanceName.TableName
写入
C:\FileName.xml
并且我只想写入列 Col1 和 Col2,我可以获得一些语法帮助吗?我在这里挣扎。
谢谢,
特德
I just realized my caps was on from working in SQL Server, ha.
Anyways, Im trying to write from
serverName.databaseName.databaseInstanceName.TableName
to
C:\FileName.xml
using bcp and I want to write only columns Col1 and Col2, could I get a little syntax help? I'm struggling over here.
Thanks,
Ted
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了创建 XML 版本的格式文件,除了使用 -x 参数之外,命令是相同的。
In order to create an XML version of the format file the command is identical except we use the -x parameter.
仅供其他人参考...
bcp“从 dbInstanceName.dbo.tableName 选择任何内容” quesryout C:\output.txt -e C:\errors.txt -c -T -S localhost\dbName
FYI for anyone else....
bcp "Select whatever from dbInstanceName.dbo.tableName" quesryout C:\output.txt -e C:\errors.txt -c -T -S localhost\dbName