在用户架构中默认创建的表 [英] Tables created by default in user schema

查看:42
本文介绍了在用户架构中默认创建的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Sql Server 2008 中,当我创建一个没有架构前缀的表时:

In Sql Server 2008, when I create a table without schema prefix:

create table mytable ( id int identify )

它通常以架构 dbo 结尾,名称为 dbo.mytable.

it usually ends up in the schema dbo, with name dbo.mytable.

但是,在我们的一台服务器上,该表最终属于我:

However, on one of our servers, the tabel ends up belonging to me:

andomar.mytable

哪个配置差异可以解释这一点?

Which configuration difference could explain this?

推荐答案

这取决于您在该数据库中的默认架构.即使在 SQL Server 2005 中,如果您在该数据库中的默认架构是 andomar,那么在没有显式架构的情况下创建的任何表都将在那里结束.

It depends what your default schema is within that database. Even in SQL Server 2005, if your default schema in that one database is andomar, then any tables created without an explicit schema will end up there.

检查该数据库中的用户属性(而不是登录属性)并查看默认架构是什么.

Check the user properties in that database (not the login properties) and see what the default schema is.

这篇关于在用户架构中默认创建的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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