如何获取“select for xml”?输出到多个文件?

发布于 2024-10-05 14:55:45 字数 161 浏览 0 评论 0原文

我们的客户抱怨我们的导出文件太长;他们希望我们将导出分成许多文件,每个文件不超过“n”条记录。有没有办法通过“select for xml”来做到这一点

目前我们在这个项目中使用Sql Server 2005。

(如果这太难了,我总是可以对单个大文件进行后期处理以将其拆分)

Our customer is complaining that our export file is too long; they would like us to split the export into many files with no more than “n” records per file. Is there a way of doing this with “select for xml”

At persent we are using Sql Server 2005 for this project.

(If this is too hard, I can always post process the single large file to split it up)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

年少掌心 2024-10-12 14:55:45

我认为这里没有什么简单易行的事情可以做。

我的方法可能是限制每个 SELECT 语句返回的行数(通过按某些条件(例如按日期或位置等)对返回的数据进行分区),然后将这些较小的 XML 流一一放入文件中。可行,但不是很优雅或复杂。

I don't think there's anything simple'n'easy you can do here.

My approach would probably be to limit the number of rows returned by each SELECT statement (by partioning the data returned by some criteria, e.g. by date or location or something), and then put those smaller XML streams into files one by one. Doable, but not very elegant or sophisticated..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文