Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2013
    Posts
    5

    Post Unanswered: why don't change my user ?

    I log in into my sql program with xxx user but when run command "print User_name" , show result "dbo" !!!!

    why ?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    In SQL Server, Logins and Users are related but quite different things!

    An MS-SQL Login is something that controls your access to the SQL Server itself. If the Login is SQL Authenticated, then it has a password. If the Login is Windows Authenticated, then it has a GUID to associate it with a Windows Login. While Logins can have server-wide permissions (like sysadmin), this is not normally the case.

    An MS-SQL User exists at the database level. Some Users like dbo and guest exist in every database, but each one is both unique and distinct... The dbo in the master database and the dbo in the msdb databases have the same name and permissions within their database, but otherwise they are unrelated. Users are granted permissions on the objects within the database.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Apr 2013
    Posts
    5
    Thanks Pat Phelan , but i dont undrstand my prob ! why dont change my user (database user ? how change it ?)


    Thanks.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You need to either spend some time understanding the differences and the relationships between Logins and Users, or you need to explain what you want to happen so that one of us can build a script for you to accomplish it.

    What you are seeing is one of the fundamental behaviors of SQL Server. This behavior puzzles everyone at first. Some people work out what is happening which takes some time but is fundamental to understanding SQL Server security. Others find someone that can help them with problems like this, but do very well with other problems. SQL Server explicitly separates two related security concepts, and not everyone can be comfortable with the mix of both simplicity and unfamiliarity that comes from that separation.

    Let me know how I can help!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •