-
Notifications
You must be signed in to change notification settings - Fork 13
SQL Execute Query action
MarkAbrams edited this page Feb 5, 2024
·
1 revision
This is an example of JSON request and response message content for a mocked SQL Execute Query action.
This request executes a stored procedure called dbo.ThisIsMyStoredProcedure
, taking two parameters:
{
"query": "EXEC dbo.ThisIsMyStoredProcedure @CustomerId, @CountryCode",
"queryParameters": {
"CustomerId": "12345",
"CountryCode": "UK"
}
}
This request executes a SQL statement, passing a Job Title as a parameter:
{
"query": "SELECT Id, FirstName, LastName, DateOfBirth, JobTitle FROM dbo.Customer WHERE JobTitle = @JobTitle",
"queryParameters": {
"JobTitle": "Footballer"
}
}
This response indicates that the query was successful and no records are returned:
[]
The test case should respond with a HTTP 200 (OK) status code.
This response indicates that the query was successful and three records are returned:
[
[
{
"Id": "12345",
"FirstName": "David",
"LastName": "Smith",
"DateOfBirth": "1997-03-23",
"JobTitle": "Footballer"
},
{
"Id": "12602",
"FirstName": "Simon",
"LastName": "Jones",
"DateOfBirth": "1993-12-01",
"JobTitle": "Footballer"
},
{
"Id": "16934",
"FirstName": "Johnny",
"LastName": "Baker",
"DateOfBirth": "1992-01-31",
"JobTitle": "Footballer"
}
]
]
The test case should respond with a HTTP 200 (OK) status code.
This response indicates that the workflow could not authenticate with the SQL database:
{
"code": "ServiceProviderActionFailed",
"message": "The service provider action failed with error code 'ServiceOperationFailed' and error message 'Login failed for user 'myusername'.'."
}
The test case should respond with a HTTP 401 (Unauthorized) status code.
- Home
- Using the Testing Framework
- Test Configuration
- Azurite
- Local Settings File
- Test Execution Logs
- Stateless Workflows
- Handling Workflow Dependencies
- Fluent API
- Automated testing using a DevOps pipeline
- Summary of Test Configuration Options
-
Example Mock Requests and Responses
- Call a Local Function action
- Invoke Workflow action
- Built-In Connectors:
- Service Bus
- SMTP
- Storage Account
- SQL Server