
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 …
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 …
sys.dm_exec_sessions (Transact-SQL) - SQL Server
Nov 18, 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.
Grant Permissions on a Stored Procedure - SQL Server
Nov 18, 2025 · Copy and paste the following example into the query window and select Execute. This example grants EXECUTE permission to all stored procedures that exist, or will exist, in …
sys.dm_exec_requests (Transact-SQL) - SQL Server
Nov 18, 2025 · To execute code that is outside SQL Server (for example, extended stored procedures and distributed queries), a thread has to execute outside the control of the non …