Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2014
    Posts
    1

    Unanswered: Get windows user name in trigger

    Dear All,

    User is login to the application using SQL Server Autentication method. I want to get his windows OS username to log in one of my security trigger.

    All of the following:
    SUSER_NAME(), SYSTEM_USER AS OSUser, SUSER_SNAME() AS SuserSName, ORIGINAL_LOGIN() As OriginalLogin, USER_NAME() as UserName
    Are returning database user name, while i need OS username.

    Kindly help

    imran

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    There is no guarantee that the user will even have an operating system login. If the account is SQL Authenticated or if there is an application server that uses an Active Directory service account the user doesn't even have to log into the operating system at all.

    Without understanding a LOT about your application and its architecture, this question is impossible to answer.

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

Tags for this Thread

Posting Permissions

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