
EXECUTE (Transact-SQL) - SQL Server | Microsoft Learn
Nov 18, 2025 · The EXEC or EXECUTE statement can be used to send pass-through commands to linked servers. Additionally, the context in which a string or command is executed can be …
sp_executesql (Transact-SQL) - SQL Server | Microsoft Learn
Nov 18, 2025 · sp_executesql executes a Transact-SQL statement or batch that can be reused many times, or one that is built dynamically.
Execute a Stored Procedure - SQL Server | Microsoft Learn
Nov 18, 2025 · This article describes how to execute a stored procedure in SQL Server by using SQL Server Management Studio or Transact-SQL. There are different ways to execute a …
Specify Parameters in a Stored Procedure - SQL Server
Nov 18, 2025 · For example, if the procedure my_proc expects three parameters named @first, @second, and @third, the values passed to the procedure can be assigned to the parameter …
EXECUTE AS (Transact-SQL) - SQL Server | Microsoft Learn
Dec 17, 2024 · When an EXECUTE AS statement is run, the execution context of the session is switched to the specified login or user name. After the context switch, permissions are …
sys.dm_exec_sessions (Transact-SQL) - SQL Server
Dec 11, 2025 · Use sys.dm_exec_sessions to first view the current system load and to identify a session of interest, and then learn more information about that session by using other dynamic …
Return Data From a Stored Procedure - SQL Server
Nov 18, 2025 · Next, execute a batch that declares a local cursor variable, executes the procedure to assign the cursor to the local variable, and then fetches the rows from the cursor.
sp_start_job (Transact-SQL) - SQL Server | Microsoft Learn
Jun 23, 2025 · You can grant EXECUTE permissions on this procedure, but these permissions might be overridden during a SQL Server upgrade. Other users must be granted one of the …
EXECUTE AS Clause (Transact-SQL) - SQL Server | Microsoft Learn
Aug 28, 2025 · To execute a CLR module specified with EXECUTE AS that accesses resources in another database or server, the target database or server must trust the authenticator of the …
sys.dm_exec_requests (Transact-SQL) - SQL Server
Nov 18, 2025 · This following example shows all currently running queries in your SQL Server data warehouse, excluding your own session (@@SPID). It uses CROSS APPLY with …