Hi @Miguel Riano Abril ,
Welcome to Microsoft Q&A!
Please refer to this related article: https://database.guide/return-the-current-login-name-in-sql-server-tsql/
And this: https://stackoverflow.com/questions/4101863/sql-server-current-user-name
Hope these could give you some ideas.
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.