locked
get windows login username RRS feed

  • Question

  • I m logged into SQL management studio with SA account. I would like to get windows login username instead of SA or DBO. like

    domainname\username.

    how do i get this info inf i login as SA into management studio.

    Thanks.

    Monday, February 23, 2015 9:33 PM

Answers

  • how do i get this info inf i login as SA into management studio.

    The answer is that you don't, because you are logged in as sa. For all that SQL Server cares you may not have logged into Windows at all, but you may be connecting from a Unix machine.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Eric__Zhang Tuesday, February 24, 2015 1:54 AM
    • Marked as answer by Eric__Zhang Wednesday, March 4, 2015 2:08 AM
    Monday, February 23, 2015 11:15 PM

All replies

  • Get a windows account created in AD and add the account in SQL Server security with a required permission then you should be able to access the database by selecting windows authentication in the SSMS server connecting wizard.

    --Prashanth

    Monday, February 23, 2015 9:38 PM
  • how do i get this info inf i login as SA into management studio.

    The answer is that you don't, because you are logged in as sa. For all that SQL Server cares you may not have logged into Windows at all, but you may be connecting from a Unix machine.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Eric__Zhang Tuesday, February 24, 2015 1:54 AM
    • Marked as answer by Eric__Zhang Wednesday, March 4, 2015 2:08 AM
    Monday, February 23, 2015 11:15 PM
  • Thank you.
    Wednesday, March 4, 2015 5:42 PM