如何“包括”另一个T-SQL脚本 [英] How to "Include" another T-SQL Script
问题描述
我希望以类似于c" include BlahBlah.H"的方式将一些T-SQL脚本拼凑到一个脚本中。功能。
我已经搜索了在线书籍和Google搜索但是所有内容都提供了通过OSQL或ISQL调用外部脚本的解决方案,而不是内联代码的延续(这就是我''之后)。
可能原因是这不是受支持的功能。如果是的话,请告诉我。我的经验水平是我每隔两三年在这里玩一次,所以我生气了。
如果有一个更有帮助的答案,那也很好当然,但我想要有当前经验的人的观点:)
I am looking to piece together a few T-SQL scripts into a single script in a way similar to the c "include BlahBlah.H" feature.
I''ve searched Online books and Googled but everything comes up with solutions that invoke an external script via OSQL or ISQL rather than a continuation of inline code (which is what I''m after).
It may well be that the reason is that this is not a supported feature. If so, please let me know. My experience level is that I get to play in here once every two or three years, so I get quite rusty.
If there is a more helpful answer that''s fine too of course, but I''d like the view of someone with the current experience :)
推荐答案
我发现 http://bytes.com/groups/ms-sql/83051...call-sql-files 在档案馆里。我怀疑这意味着在T-SQL中不支持这个想法。
如果有人知道任何相反的事情,请发帖。否则,我怀疑这个问题可以被认为是回答了。
I found http://bytes.com/groups/ms-sql/83051...call-sql-files in the archives. I suspect this means there is no support for this idea in T-SQL.
If anyone knows anything to the contrary then please post. Otherwise, I suspect this question can be considered to be answered.
你能把它们保存为存储过程并以这种方式调用吗?
Could you save them as stored procedures and call them that way?
我想如果我考虑SQL Server通常如何工作,那将是最好的解决方案。我是从一种不同的思维模式(基于文件系统)开始的,因为我现在还没有进入SQL Server模式。
我认为这是实际上是逻辑解决方案谢谢普拉特:)
I suppose if I got my thinking around how SQL Server generally works, that would be the best solution. I''m coming at it from a sort of different mind-set (file system based) because I''m not in SQL Server mode at the moment.
I think that is actually the logical solution. Thanks Plater :)
这篇关于如何“包括”另一个T-SQL脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!