You’ll have to do a little bit of song and dance in your .NET app, but not too much. To get the name of the current Windows user, the following expression will suffice (tested in C#, but should work in VB):
System.Security.Principal.WindowsIdentity.GetCurrent().Name
You can include that in your connection string, appended to the Application Name or Workstation ID, and then access the value of these connection properties via the built-in T-SQL functions HOST_NAME() and APP_NAME(). This way, you can get these values transparently where necessary for your audit code without having to explicitly pass the user name as a parameter to every single stored procedure call.
Though truthfully, I’d recommend simply using Windows authentication in SQL Server, and getting the user’s login name via SUSER_SNAME().









