SQL Server 架构有什么好处? [英] What good are SQL Server schemas?

查看:50
本文介绍了SQL Server 架构有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是使用 SQL 数据库的初学者,尤其是 SQL Server.然而,我主要是一个 SQL 2000 人,我一直对 2005+ 的模式感到困惑.是的,我知道架构的基本定义,但它们在典型的 SQL Server 部署中真正用于什么?

I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and I've always been confused by schemas in 2005+. Yes, I know the basic definition of a schema, but what are they really used for in a typical SQL Server deployment?

我一直只使用默认架构.为什么我要创建专门的模式?为什么要分配任何内置架构?

I've always just used the default schema. Why would I want to create specialized schemas? Why would I assign any of the built-in schemas?

澄清一下,我想我正在寻找模式的好处.如果您只想将其用作安全方案,那么似乎数据库角色已经填补了那个......呃......嗯......角色.使用 a 作为命名空间说明符似乎是您可以通过所有权完成的事情(dbo 与用户,等等).

To clarify, I guess I'm looking for the benefits of schemas. If you're only going to use it as a security scheme, it seems like database roles already filled that.. er.. um.. role. And using it a as a namespace specifier seems to have been something you could have done with ownership (dbo versus user, etc..).

我想我的意思是,Schemas 能做什么而你不能对所有者和角色做些什么?它们的具体好处是什么?

I guess what I'm getting at is, what do Schemas do that you couldn't do with owners and roles? What are their specifc benefits?

推荐答案

架构在逻辑上将表、过程、视图组合在一起.employee 架构中所有与员工相关的对象,等等.

Schemas logically group tables, procedures, views together. All employee-related objects in the employee schema, etc.

您还可以仅授予一个架构的权限,以便用户只能看到他们有权访问的架构,而看不到其他任何内容.

You can also give permissions to just one schema, so that users can only see the schema they have access to and nothing else.

这篇关于SQL Server 架构有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆