# Microsoft SQL Node Execute none queries

**URL:** <https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284>\
**Category:** Questions\
**Tags:** microsoft-sql\
**Created:** [July 17, 2024, 1:40pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284 "2024-07-17T13:40:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zetanova](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zetanova/32/31663_2.png) [@Zetanova](https://community.n8n.io/u/Zetanova)\
**Post date:** [July 17, 2024, 1:40pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/1 "2024-07-17T13:40:10Z")

</div>

The current ms sql node 1.1 in n8n 1.47.1 has a problem with executing none query commands.

I want to execute backup commands and the result type is not handled correctly.

Command:  
BACKUP LOG mydb  
TO URL = ‘s3://gateway.storjshare.io/my-bucket/mydb\_20240717\_02.trn’  
WITH FORMAT, MAXTRANSFERSIZE = 10485760, STATS = 10, COMPRESSION, ENCRYPTION (ALGORITHM = AES\_256, SERVER CERTIFICATE = mydb\_2024);

Result:

```auto
{
  "errorMessage": "Internal error",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.47.1 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: result is not iterable",
      " at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js:218:41)",
      " at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      " at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:664:51",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1076:20"
    ]
  }
}

```

SQL Studio Result is composed of only message output:  
100 percent processed.  
Processed 8 pages for database ‘mydb’, file ‘mydb\_log’ on file 1.  
BACKUP LOG successfully processed 8 pages in 0.584 seconds (0.100 MB/sec).

Completion time: 2024-07-17T15:28:14.7160653+02:00

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [July 17, 2024, 1:40pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/2 "2024-07-17T13:40:11Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![Zetanova](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zetanova/32/31663_2.png) [@Zetanova](https://community.n8n.io/u/Zetanova)\
**Post date:** [July 17, 2024, 1:42pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/3 "2024-07-17T13:42:02Z")

</div>

- **n8n version: 1.47.1**
- **Database (default: SQLite): postgres**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main): main**
- **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker**
- **Operating system: ubuntu**

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [July 19, 2024, 3:12pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/6 "2024-07-19T15:12:15Z")

</div>

Hi @Zetanova

We have just put better error logging in place with a recent release - if you could update to [1.51.0](https://github.com/n8n-io/n8n/pull/10023) and try again and see what the error says?

We may not support all SQL admin queries, but need to make sure first if this could really be the issue here.

Thanks 🙏

---

<div class="post-metadata">

**Author:** ![Zetanova](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zetanova/32/31663_2.png) [@Zetanova](https://community.n8n.io/u/Zetanova)\
**Post date:** [July 21, 2024, 3:01pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/7 "2024-07-21T15:01:41Z")

</div>

Here here error output, the error message is the same, would be nice to be able to execute no query operations for maintenance and other things.

```auto
n8n version

1.50.1 (Self Hosted)

Stack trace

TypeError: result is not iterable at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js:218:41) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:725:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20

```

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 22, 2024, 4:04pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/8 "2024-07-22T16:04:27Z")

</div>

Hey @Zetanova,

That looks to be `1.50.1` can you try `1.51.0`?

---

<div class="post-metadata">

**Author:** ![Zetanova](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zetanova/32/31663_2.png) [@Zetanova](https://community.n8n.io/u/Zetanova)\
**Post date:** [July 22, 2024, 7:28pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/9 "2024-07-22T19:28:07Z")

</div>

Current `latest` : 1.50.1  
Current `next` : 1.51.0

Then we need to wait that the version will go into prod.  
I need to rebuild the docker image only to add a ssl certificate into the cert store.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 23, 2024, 2:21pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/10 "2024-07-23T14:21:26Z")

</div>

Hey @Zetanova,

Instead of making a new docker image you can now just add your certificates to a volume mounted at `/opt/custom-certificates` and it should make life a bit easier (more info on that here: [Configure n8n to use your own certificate authority | n8n Docs](https://docs.n8n.io/hosting/configuration/configuration-examples/custom-certificate-authority/))

I suspect the issue here could be that the underlying package we use doesn’t support running commands or the response is not being handled correctly. I will see if we can set up SQL locally to do some testing as well.

---

<div class="post-metadata">

**Author:** ![thajesta](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thajesta/32/35175_2.png) [@thajesta](https://community.n8n.io/u/thajesta)\
**Post date:** [July 26, 2024, 8:30pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/11 "2024-07-26T20:30:16Z")

</div>

Hi,

I get the same error when I use the SQL node for executing an insert query.

This is the workflow I’m using:

- **n8n version: 1.51.1**
- **Database (default: SQLite): Sql Server**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main): main**
- **Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud**
- **Operating system: Windows**

---

<div class="post-metadata">

**Author:** ![nineforty5](https://avatars.discourse-cdn.com/v4/letter/n/b19c9b/32.png) [@nineforty5](https://community.n8n.io/u/nineforty5)\
**Post date:** [July 27, 2024, 4:20am UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/12 "2024-07-27T04:20:56Z")

</div>

I get the same error. As a workaround, I just add a second select query after the insert/update and no error is reported.

e.g.

SELECT 1 AS result;

---

<div class="post-metadata">

**Author:** ![thajesta](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thajesta/32/35175_2.png) [@thajesta](https://community.n8n.io/u/thajesta)\
**Post date:** [July 27, 2024, 5:47am UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/13 "2024-07-27T05:47:26Z")

</div>

Hi @nineforty5,

That doesn’t work for me. The only way to fix this, is to set the setting for ‘On Error’ on ‘Continue’. This is for me the only way to let the workflow work without it to stop.

---

<div class="post-metadata">

**Author:** ![Zetanova](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/zetanova/32/31663_2.png) [@Zetanova](https://community.n8n.io/u/Zetanova)\
**Post date:** [August 5, 2024, 6:16pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/14 "2024-08-05T18:16:27Z")

</div>

@Jon thanks for the certificate tip, n8n starts with `

```auto
Trusting custom certificates from /opt/custom-certificates.
ERROR: Access denied '/opt/custom-certificates'
User settings loaded from: /home/node/.n8n/config
Initializing n8n process
n8n ready on 0.0.0.0, port 5678
...

```

I exec into the container and checked the permissions (644), i could list the file and read the pem content from the directory

The issue is still persisting in 1.52.2, the command is executed successfully but the node simply does not handle the result type.

@nineforty5 the workaround with a second command does work for sql backup command. It will error on failure and succeed on completion.

```auto
{
  "errorMessage": "Internal error",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.52.2 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: result is not iterable",
      " at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Sql/MicrosoftSql.node.js:218:41)",
      " at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      " at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20"
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![Elkozel](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/elkozel/32/45607_2.png) [@Elkozel](https://community.n8n.io/u/Elkozel)\
**Post date:** [October 1, 2024, 9:07pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/15 "2024-10-01T21:07:28Z")

</div>

I had the same issue with the permissions for certificates, but it turned out that the directory itself (`/opt/custom-certificates`) that did not have the correct permissions (for me the permissions were ‘root:root’). Please make sure that the mapped volume directory (the `./pki` directory in [the example](https://docs.n8n.io/hosting/configuration/configuration-examples/custom-certificate-authority/?_gl=1*1ddyuo7*_gcl_au*MjQxNzEwOTQ3LjE3Mjc4MTI0NjI.*_ga*MTM1Nzk1MzcyNi4xNzI3ODA1Mjcx*_ga_0SC4FF2FH9*MTcyNzgxMjM4OS4yLjEuMTcyNzgxNjcyOC40OC4wLjA.)) has the correct permissions.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [December 30, 2024, 9:07pm UTC](https://community.n8n.io/t/microsoft-sql-node-execute-none-queries/50284/16 "2024-12-30T21:07:43Z")

</div>

Closed on December 30, 2024, 9:07pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
