I have created a "Status Change Email" trigger on
a "tblProjects" in SQL Server Enterprise Manager that
would automatically fire a trigger when someone changes
the "Status" field's value in the "tblProjects" . The changesto the status are made in a "Projects" form which has theunderlying table as "tblProjects" . I have an "ModifiedBy " field in the same tblProjects that would fetch the value from theCurrent User Name (To know who actually made the change).
I have made the default value for "ModifiedBy" field in
the "tblProjects" on SQL Server as "(user_name())".
When I go back and make changes to the Status field in
the "Projects" form record, and move to the next record
the email is triggerd. I get a email message with
the "ModifiedBy" value for the record I edited as "dbo" instead of the user name who actually changed the value.
The code doesn't pick up the current user name. Can you
please help me with troubleshooting the following error.