Sybase SP 结果存入临时表
你好, 我有一个 SP,它返回 100 多个字段和 1000 多行。我需要将所有内容保存在临时表中,然后朗读我的自定义查询以获取适当的数据。
我做了很多搜索,但无法找到适合我的项目的解决方案。如果有人能分享他的想法,我将不胜感激。
创建表#SP_Result (我需要根据SP返回结果动态创建字段)
exec Ministry..civil_record "2010-08-07","Autogen",20,NULL,NULL,NULL,NULL,NULL,NULL,NULL
我需要将结果从 SP 转储到 #SP_Result。
HI,
I have a SP which returning more than 100 fields with 1000+ row. I need to to save all in temp table and and rum my customize query to get the appropriate data.
I did many search but i am unable to find the right solutions for my project. I will appreciate if anyone can share his idea.
create table #SP_Result
(i need to create field dynamically according to the SP return result )
exec Ministry..civil_record
"2010-08-07","Autogen",20,NULL,NULL,NULL,NULL,NULL,NULL,NULL
I need dump the result from SP to #SP_Result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不在“自定义查询”中运行查询本身,而不是尝试捕获存储过程的结果集?这是正常的方法。
所有这些空值看起来就像是非规范化“表”的混蛋,其中许多行不适用于该任务。以标准化、面向集合的方式处理数据库要快得多。
Why don't you run the query itself, in your "customised query", rather than try to capture the result set of the stored proc ? That's the normal method.
All those Nulls look like a bastard of a de-normalised "table", where many rows will not apply to the task. It is much, much faster to deal with the database in a normalised, set-oriented manner.