SQL Interview: 65 Auditing user actions in T-SQL
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Security Level: Medium
Question:
You have code in stored procedures that records which users have called the procedures. The stored procedures are defined as:
WITH EXECUTE AS OWNER
You find that when you log the caller of the procedure, you get the owner of the procedure, rather than the caller.
2025-07-23