I have a trigger written in sql clr (sql 2005, .net 3.5) and I need to get at username, hostname and app_name. In TSQL I would simply use
select suser_name()
select host_name()
select APP_NAME()
In my .Net code I tried
System.Security.Principal.WindowsIdentity.GetCurrent().Name
System.Environment.MachineName
System.AppDomain.CurrentDomain.ApplicationIdentity.FullName
but running in safe mode I do not have access to any of these properties. Any ideas on how to acomplish this?
Thanks