Hi Guys,
How can I get the current loged in UserName in windows in MSSQL?
The problem is:
Users login into their PC (Windows Login)Enter a URL of the intranet applicationThey would then be able to access the web base application (Intranet)The web application has a string connection to make a connection to the databaseI want to have a Trigger for my "products" table so if the table is modified (Insert/Update) all those changes be entered in "products_Audit" tableNow on "products_Audit" table I have a field "ChangedBy" where I want to store the windows loged in User Name (SYSTEM_USER just return the Username for the SQL connection that the web application use)I would really appreciate all your help and suggestions.
Regards,
Mehdi
Hello,
In case of IntraNet where directory security does not allow anonymous users, then you can retrieve domain user information.
dim user as string = Request.ServerVariables("LOGON_USER")
and pass this variable for your database action query.
No comments:
Post a Comment