January 31, 2005 at 11:12 am
I am currently testing these functions logon on a NT windows ID onto database Pubs.
User_name function returns "dbo" ( same as Current_user function)
System_User returns "ServerName\User"
Session_user returns "dbo"
Host_name returns "ServerName"
Questions...
I understand when the System_User changes when NT logon is different, I also undertand when server name changes, BUT when does User_Name change from dbo ( does this change when logon is not using NT windows identification) ?
How is dbo "database owner" used ?
January 31, 2005 at 6:29 pm
I think I can answer my own question...
I found this on BOL...
Second paragraph.. makes the point..
The dbo is a user that has implied permissions to perform all activities in the database. Any member of the sysadmin fixed server role who uses a database is mapped to the special user inside each database called dbo. Also, any object created by any member of the sysadmin fixed server role belongs to dbo automatically.
For example, if user Andrew is a member of the sysadmin fixed server role and creates a table T1, T1 belongs to dbo and is qualified as dbo.T1, not as Andrew.T1. Conversely, if Andrew is not a member of the sysadmin fixed server role but is a member only of the db_owner fixed database role and creates a table T1, T1 belongs to Andrew and is qualified as Andrew.T1. The table belongs to Andrew because he did not qualify the table as dbo.T1.
The dbo user cannot be deleted and is always present in every database.
Only objects created by members of the sysadmin fixed server role (or by the dbo user) belong to dbo. Objects created by any other user who is not also a member of the sysadmin fixed server role (including members of the db_owner fixed database role):
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply