{EXEC|EXECUTE}AS<context_specification>[;]<context_specification>::={LOGIN|USER} ='name'[WITH{NOREVERT|COOKIEINTO@varbinary_variable} ] |CALLER 参数 LOGIN 适用于:SQL Server 2008 (10.0.x) 及更高版本。 指定要模拟的执行上下文是一个登录名。 模拟范围处于服务器级别。
EXECUTE AS SELF等效于EXECUTE AS <user_name>指定用户创建或更改模块的人员。 创建或修改模块的人员的实际用户 ID 存储在execute_as_principal_id或sys.service_queues目录视图中的sys.sql_modules列中。 SELF是队列的默认值。 备注 若要更改目录视图中列sys.service_queues的用户 IDexecute_as_principal_id,必须在...
EXECUTE AS SELF等效于EXECUTE AS <user_name>指定用户创建或更改模块的人员。 创建或修改模块的人员的实际用户 ID 存储在execute_as_principal_id或sys.service_queues目录视图中的sys.sql_modules列中。 SELF是队列的默认值。 备注 若要更改目录视图中列sys.service_queues的用户 IDexecute_as_principal_id,必须在...
By default, a session starts when a user logs in and ends when the user logs off. All operations during a session are subject to permission checks against that user. When an EXECUTE AS statement is run, the execution context of the session is switched to the specified login or user name....
AS SELECT user_name(); GO 使用EXECUTE AS CALLER 独立语句 使用模块内的 EXECUTE AS CALLER 独立语句将执行上下文设置为模块调用方。 假定SqlUser2调用以下存储过程。 CREATE PROCEDURE dbo.usp_Demo WITH EXECUTE AS 'SqlUser1' AS SELECT user_name(); -- Shows execution context is set to SqlUser1. ...
The EXECUTE AS statement can succeed as long as the Database Engine can resolve the name. If a domain user exists, Windows might be able to resolve the user for the Database Engine, even though the Windows user does not have access to SQL Server. This can lead to a condition where a...
sp_executesql支援與 Transact-SQL 字串分開的參數值設定,如下列範例所示。 SQL DECLARE@IntVariableASINT;DECLARE@SQLStringASNVARCHAR(500);DECLARE@ParmDefinitionASNVARCHAR(500);/* Build the SQL string once */SET@SQLString = N'SELECT BusinessEntityID, NationalIDNumber, JobTitle, LoginID FROM AdventureWo...
how can i execute a STRING as a query in MuSQL? there is a way to do this in SQLServer 2000, there we can use EXEC(STRING) and the string will be executed. Additional Notes: i need this because i've got a select statement in an stored procedure that uses an ORDER BY clause at ...
Informations de référence sur Transact-SQL (T-SQL) Informations de référence sur Transact-SQL (T-SQL) Date et heure Méthodes hierarchyid (moteur de base de données) Numérique String et binary Instances et géographie spatiales (Type de données geography) Instances et géométrie spatiales (Ty...
Database string 是 数据库名称。 test ContinueAfterTimeout boolean 否 如果调用超时,选择是否继续运行 SQL 语句,取值如下: true:继续运行 false:停止运行 说明 默认情况下,SQL 语句在调用超时后停止运行。 true FormatRecordsAs string 否 是否将结果集格式化为单个 JSON 字符串。 仅允许传入 NONE 或JSON。 默...