seniorT-SQL

What is execution context switching in SQL Server?

Updated May 17, 2026

Short answer

Execution context switching happens when SQL Server changes security context during execution.

Deep explanation

When using EXECUTE AS or impersonation, SQL Server switches security context, affecting permissions, ownership chaining, and access control. This can introduce overhead and security risks if misused.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More T-SQL interview questions

View all →