DEP006

SETUSER statement is deprecated

SETUSER statement is there only for backward-compatibility.

Since SQL Server 2008, it has been possible to use EXECUTE AS, which is much clearer.


This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved


Didn't find what you were looking for?