Re: object can't be accessed unless owner is specified - SQL 2000
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 14 Jul 2009 22:06:29 +0000 (UTC)
THE.Ronald (THERonald@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
"Erland Sommarskog" wrote:
The you did the restore, and now the SELECT above would fail with error
208, Object not found. However, "SELECT ... FROM Sune.tbl" would fail.
The only reasonable explanation is that at this point Sune was the
database owner, and thus the login Sune mapped to dbo and had dbo
as its default schema.
Thx for the reply. Both did NOT fail, the qualfied query with the owner
worked.
Sorry, I lost a "not" there. The first paragraph was intended to end
"...would not fail".
Sune (continuing your example) was the database owner and owned the
objects as well.
If login Sune was the database owner, he mapped to the user dbo, and
thus his default schema was dbo. To access objects in Sune schema,
he would need to prefix them with the schema.
Does SQL 2000 actually have schemas ? It mimics them, but I didn't think
there was a place to define that.
SQL 2000 certainly has schemas! But there is a one-to-one mapping to
owner, so we mainly think of them as owners, rather than schemas. Or
at least we used to think until we saw the light with SQL 2005.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: object can't be accessed unless owner is specified - SQL 2000
- From: THE.Ronald
- Re: object can't be accessed unless owner is specified - SQL 2000
- References:
- object can't be accessed unless owner is specified - SQL 2000
- From: THE.Ronald
- Re: object can't be accessed unless owner is specified - SQL 2000
- From: Erland Sommarskog
- Re: object can't be accessed unless owner is specified - SQL 2000
- From: THE.Ronald
- object can't be accessed unless owner is specified - SQL 2000
- Prev by Date: Re: Cannot generate SSPI context
- Next by Date: Re: Preventing access to Process Info
- Previous by thread: Re: object can't be accessed unless owner is specified - SQL 2000
- Next by thread: Re: object can't be accessed unless owner is specified - SQL 2000
- Index(es):
Relevant Pages
|