Groups | Blog | Home
all groups > sql server (microsoft) > may 2007 >

sql server (microsoft) : Why, after restoring a database, do I have to prefix all objects?


atoner.spam NO[at]SPAM gmail.com
5/23/2007 1:33:52 PM
I recently implemented log shipping and wanted to test that the
shipped version of the database I was restoring to was operational.
So, I detached it from Sql Server, made a copy, and reattached it
under a new database name.

Then, I created a new server login called "sqlaccount" that should map
to a database user with the same name. Initially the sids didn't match
and I had to run a query I found in a KB article to re-sync the sids
together. Now the db user and sql login have matching sids and names.
Also, "sqlaccount" is dbo for my database.

Why is it that now when addressing any table in this database, when
logged in as "sqlaccount", I have to prefix every object name with
"sqlaccount"."object" to use it? If I leave off the prefix, the object
cannot be found. Initially I thought it was because the sids didnt
match, but I have verified that they now do. I also called user_name()
and suser_sname() to verify that I am logged in as "sqlaccount". I
also have verified the objects I am trying to access are owned by
"sqlaccount".

Can anyone provide any insight as to what I have missed here?

Thanks,
-Sean-
Ed Murphy
5/24/2007 8:52:17 AM
[quoted text, click to view]

I seem to remember SQL Server 2005 changing something about the
atoner.spam NO[at]SPAM gmail.com
5/30/2007 7:30:08 AM
[quoted text, click to view]

This is SQL 2000, I'm afraid.
AddThis Social Bookmark Button