TSQL 命名约定 ~ 这个命名约定叫什么?
鉴于我使用的是 TSQL,这种命名方式的名称是什么?
\\servername\instance.database.schema.table
以及可以插入哪些其他项目来代替 .dbo。在前面的命名实例中?如何着手创造这些替代方案?欢迎链接到答案
另外,如何引用服务器上的作业而不是表或存储过程?
我的意图是,当我将我的工作写成文档时(比如当我关闭我的 FogBugz 票证或其他东西时),那么我希望至少能够听起来好像我知道我在做什么执行 ;)
(根据链接和评论更新)
Given that I'm using TSQL, what's the name of this style of naming?
\\servername\instance.database.schema.table
and what other items can be inserted in place of .dbo. in the previous naming instance? how does one go about creating those alternatives? links to answers welcome
Also, how would one refer to a job on the server instead of a table or a sproc?
My intention is for when I write up my work for documentation (say when I'm closing out my FogBugz ticket or something) then I want to be able to at least sound like I know what I'm doing ;)
(updated per links and comments)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
三&四个部分名称是我遇到的最常见的参考,但是 如您所见- 有很多速记替代品。
Three & four part name are the most common references I've come across, but as you can see - there's lots of shorthand alternatives.
dbo
是架构。您可以创建新架构并将数据库对象分配给该架构。The
dbo
is the schema. You can create new schemas and assign db objects to the schema.这就是整个路径。如果您要访问默认架构中的表(默认情况下为 dbo),您所需要的只是表。 (SELECT * FROM Addresses)
如果您要访问用户默认模式以外的模式上的表(或者您想保护自己免受未来更改的影响),那么您将放置 Schema.Table。 (SELECT * FROM Customers.Addresses)
如果您希望访问同一服务器内不同数据库上的表,则需要输入 DatabaseName.Schema.Table。 (SELECT * FROM ProductionDB.Customers.Addresses)
最后,如果您希望同时访问不同服务器上的表,则需要完整路径。这些机器还必须有服务器链接,据我所知。
That is the entire path. If you're hitting a table within your default schema (this is dbo by default) all you need is table. (SELECT * FROM Addresses)
If you're hitting a table on a schema other than the user's default (or you want to protect yourself from future changes) then you'll put Schema.Table. (SELECT * FROM Customers.Addresses)
If you're looking to hit a table on a different database within the same server, you will need to put DatabaseName.Schema.Table. (SELECT * FROM ProductionDB.Customers.Addresses)
Finally, if you're looking to a hit a table on a different server all-together, you need the full path. These machines must also have a server-link, AFAIK.