除了将脚本存储在某种源代码管理中之外,也许将它们存储在 Share Point 站点或网络文件共享上也适合您的团队。 共享脚本时面临的真正挑战是人们有不同的方式来识别他们正在寻找的内容。 允许标记查询所做的不同类型的事情的 wiki 类型的网站将会很有用。
If it is something that I would call "common" I would probably create a stored procedure that the folks with necessary permissions can run.
If the stored procedure route won't work well for your team, then the other option is to create a view. Creating a view comes with unique challenges though such as ensuring that everyone running the view has select permissions on all of the tables in the view as well.
Outside of storing the scripts in source control of some kind, maybe storing them on a Share Point site or a network file share would work OK for your team. The real challenge that you will have in sharing scripts is that people have different ways to identify what they are looking for. A wiki type of site that allows tagging the different types of things the queries do would be useful.
发布评论
评论(5)
似乎操作员想知道如何向团队传达有关其他人可以/应该使用的有用 SQL 的信息,以免重新创建。
我过去是通过两种方式做到这一点的:
详细介绍了 SQL 以及示例
它被使用了。
创建了应该共享的内容。
当然,我们总是将 SQL 代码包含在版本控制中,只是在“发布信息”部分使用 wiki 和电子邮件。
Seems like the op wants to know how to get the word out to the team about useful SQL that others can/should use so not to recreate.
How I have done this in the past is through two ways:
details the SQL with examples of how
it is used.
created that should be shared.
Of course, we always include the SQL code in version control, just the wiki and email are use in the "getting word out there" part.
如果这是我称之为“常见”的东西,我可能会创建一个存储过程,具有必要权限的人员可以运行它。
如果存储过程路线不适合您的团队,那么另一个选择是创建视图。创建视图会带来独特的挑战,例如确保运行该视图的每个人也对该视图中的所有表都具有选择权限。
除了将脚本存储在某种源代码管理中之外,也许将它们存储在 Share Point 站点或网络文件共享上也适合您的团队。 共享脚本时面临的真正挑战是人们有不同的方式来识别他们正在寻找的内容。 允许标记查询所做的不同类型的事情的 wiki 类型的网站将会很有用。
If it is something that I would call "common" I would probably create a stored procedure that the folks with necessary permissions can run.
If the stored procedure route won't work well for your team, then the other option is to create a view. Creating a view comes with unique challenges though such as ensuring that everyone running the view has select permissions on all of the tables in the view as well.
Outside of storing the scripts in source control of some kind, maybe storing them on a Share Point site or a network file share would work OK for your team. The real challenge that you will have in sharing scripts is that people have different ways to identify what they are looking for. A wiki type of site that allows tagging the different types of things the queries do would be useful.
您创建一个视图。
You create a view.
有很多方法可以做到这一点(包括您已经提到的一些方法):
Lots of ways to do this (including some that you've mentioned already):
视图是处理此类事情的正确方法。 或者,在某些情况下,存储过程。
但没有规则规定您不能也在源代码管理中存储视图或存储过程的 DDL。
Views are the right way to handle this sort of thing. Or, in some cases, a stored procedure.
But there's no rule that says you can't also store the DDL for a View or a Stored Procedure in source control.