Getting the current membership user that inserted or updated in a SQL Server 2008 trigger

Is there a way to get the userId of an aspnet_Membership user who inserted or updated a table entry in a trigger?

The existing procedure is a trigger that records the insertion and updating of certain tables.

I need to know how to get the userId of an aspnet_Membership user who inserted or updated an entry in a table.

Thanks in advance.

+4
source share
1 answer

You will get a username using this code

MembershipUser user = Membership.GetUser(); if (user != null) string name = user.UserName; 
0
source

All Articles