-
-
Notifications
You must be signed in to change notification settings - Fork 24
EXEC queries
SQL 4 CDS translates EXEC
queries to execute a built-in message or custom action or custom API using stored procedure syntax.
The supported syntax is the same as SQL Server
with the exception that the OUTPUT
clause is not supported.
Not all messages, custom actions or custom APIs are supported. To be able to be invoked as a stored procedure, all request fields for the message (represented as input parameters to the stored procedure) must be scalar values (except for a single PagingInfo parameter if the output is an entity collection), and the response fields (if any) must be either:
- A single field of an entity-derived type, or
- A single field of an entity collection, or
- A single field of an array of a scalar type, or
- Any number of fields of a scalar type
If there is an entity type output parameter but the message metadata does not identify what type that entity will be, it will be returned as a JSON-formatted string. Otherwise, a column will be included in the output for each column defined for that entity type.
DECLARE @UserId UNIQUEIDENTIFIER
EXEC WhoAmI @UserId = @UserId OUTPUT
SELECT @UserId