Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 122f8e0

Browse files
committed
Fix the statement for sp_send_dbmail query parameter.
1 parent 1e3bfa8 commit 122f8e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/relational-databases/system-stored-procedures/sp-send-dbmail-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ sp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
125125
Is a query to execute. The results of the query can be attached as a file, or included in the body of the e-mail message. The query is of type **nvarchar(max)**, and can contain any valid [!INCLUDE[tsql](../../includes/tsql-md.md)] statements. Note that the query is executed in a separate session, so local variables in the script calling **sp_send_dbmail** are not available to the query.
126126

127127
>[!NOTE]
128-
> When using `@query` parameter, `@profile_name` cannot reference principal that belongs to an Azure AD group. If Azure AD authentication is used, principal needs to be directly mapped to Azure AD server principal (login), otherwise it will not effectively be able to execute the query. This is due to Azure SQL Managed Instance impersonation and EXECUTE AS [limitations](https://docs.microsoft.com/azure/azure-sql/managed-instance/transact-sql-tsql-differences-sql-server#logins-and-users).
128+
> When using `@query` parameter, user that executes `sp_send_dbmail` must be SQL login or directly mapped to principal (login) of Azure AD or AD. If user is member of Azure AD group or AD group it will not be able to execute the query. This is due to Azure SQL Managed Instance impersonation and EXECUTE AS [limitations](https://docs.microsoft.com/azure/azure-sql/managed-instance/transact-sql-tsql-differences-sql-server#logins-and-users).
129129
130130
`[ @execute_query_database = ] 'execute_query_database'`
131131
Is the database context within which the stored procedure runs the query. The parameter is of type **sysname**, with a default of the current database. This parameter is only applicable if **\@query** is specified.

0 commit comments

Comments
 (0)