lu.[TableName]而不是dbo.[TableName]? [英] lu.[TableName] instead of dbo.[TableName]?

查看:146
本文介绍了lu.[TableName]而不是dbo.[TableName]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的SQL Server 2005数据库中的某些表被命名为lu.[TableName]而不是dbo.[TableName].鲁代表什么?

Some of the tables in my SQL Server 2005 database is named as lu.[TableName] instead of dbo.[TableName]. What does lu stand for?

注意:我已经尝试过Google

Note: I tried google already

推荐答案

这将是SQL Server 2005中的架构-您可以使用CREATE SCHEMA创建自己.

That would be a schema in SQL Server 2005 - which you can create yourself using CREATE SCHEMA.

模式可用于分离逻辑上属于一起的数据库对象,例如将与人力资源相关的所有表放入"HR"模式等.DB模式有点像.NET或XML命名空间.

A schema can be used to separate out database objects that logically belong together, e.g. put all tables related to human resources into a "HR" schema etc. DB Schemas are a bit like .NET or XML namespaces.

模式也可以用于处理权限,例如您可以在架构级别将权限委派给用户和角色.

A schema can also be used to handle permissions, e.g. you can delegate permissions to user and roles on a schema level.

看一下示例AdventureWorks数据库,该数据库广泛使用模式.

Have a look at the sample AdventureWorks database which uses schemas extensively.

这也是您始终应使用"dbo"限定数据库对象的原因之一.字首.如果不这样做,SQL Server的查询引擎将首先必须检查您的默认架构(该名称可能与dbo不同)以查找具有该名称的对象,如果找不到,则转到dbo架构.如果您始终使用"dbo.YourTableName",则查询引擎会知道在哪里查找-性能获得很小的提升(成千上万次访问会成倍增加).

That's also one of the reasons you should always qualify your database objects with the "dbo." prefix. If you don't, SQL Server's query engine will first have to check your default schema (which could be different from dbo) for the object of that name, and if not found it goes to the dbo schema. If you always use "dbo.YourTableName", the query engine knows upfront where to look - a tiny performance gain (which gets multiplied by thousands of accesses).

这篇关于lu.[TableName]而不是dbo.[TableName]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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