
EXECUTE (Transact-SQL) - SQL Server | Microsoft Learn
Aug 28, 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
Jun 23, 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
May 15, 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 …
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 …
sp_send_dbmail (Transact-SQL) - SQL Server | Microsoft Learn
The query is of type nvarchar (max), and can contain any valid Transact-SQL statements. The query is executed in a separate session, so local variables in the script calling sp_send_dbmail …
sys.dm_exec_requests (Transact-SQL) - SQL Server
Oct 2, 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 …
Grant Permissions on a Stored Procedure - SQL Server
Aug 8, 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 …
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 …
Return Data From a Stored Procedure - SQL Server
Dec 17, 2024 · 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.