I have a stored procedure that runs this to create a new ticket number:
INSERT INTO [Test_DB42].[dbo].[TicketNumber]
([On], [By])
VALUES (CURRENT_TIMESTAMP, CURRENT_USER)
When I start with a user with db_datareader and execute permissions, I get the ActiveAlAccountName Active Directory value that I want - this user gets access through the AD group that has the login.
When I start the user with the sysadmin role, he simply says "dbo". This use has an explicit Login for your AD account.
Is there a way to change this or return the username samAccountName or the SQL name?
source
share