Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

...

You can use this Snap to execute arbitrary SQL query. This Snap supports SQL Server 2008 or a later version.

This Snap works only with single queries.

Valid JSON paths that are defined in the WHERE clause for queries/statements will be substituted with values from an incoming document. Documents are written to the error view if the document is missing a value to be substituted into the query/statement. If a SELECT query is executed, the query's results are merged into the incoming document and any existing keys will have their values overwritten. On the other hand, the original document is written if there are no results from the query. If an output view is available and an UPDATE/INSERT/MERGE/DELETE statement was executed, then the original document that was used to create the statement will be output with the status of the statement executed.

...

Error

Reason

Resolution

Failure: Batch operation failed. Error code: 102

Incorrect syntax near 'GO'.

Rewrite the query without ‘GO’ and run it.

Example

In this example, we have a table named "customer1" that stores user details. It has the columns: productphonenocustomernamecitycountry. We will execute the query and retrieve customers with given name.

...