# "USE statement is not supported" when inserting into Azure SQL PaaS

**URL:** <https://discourse.nodered.org/t/use-statement-is-not-supported-when-inserting-into-azure-sql-paas/71036>\
**Category:** General\
**Tags:** database, microsoft-azure\
**Created:** [22 November 2022 08:11 UTC](https://discourse.nodered.org/t/use-statement-is-not-supported-when-inserting-into-azure-sql-paas/71036 "2022-11-22T08:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![demokedes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/demokedes/32/19082_2.png) [@demokedes](https://discourse.nodered.org/u/demokedes)\
**Post date:** [22 November 2022 08:11 UTC](https://discourse.nodered.org/t/use-statement-is-not-supported-when-inserting-into-azure-sql-paas/71036/1 "2022-11-22T08:11:42Z")

</div>

Dear all,  
I am using the recent version of node-red-contrib-mssql-plus node. I am inserting some data into the SQL Managed database on Azure (I am not having SQL DB server but PaaS version of Database).  
Majority of inserts are sucesull....but randomly I am getting this error:  
"USE statement is not supported to switch between databases. Use a new connection to connect to a different database. (Incorrect syntax near 't'.)"  
I am not sure if some records are missed, but I would like to understand why this error is happening. Me personally...I am not using "USE" anywhere in my code.  
Thank you for your ideas in advance!  
ROk

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 November 2022 10:52 UTC](https://discourse.nodered.org/t/use-statement-is-not-supported-when-inserting-into-azure-sql-paas/71036/2 "2022-11-22T10:52:00Z")

</div>

Could you try and capture the full error?

Add a catch node & point it at the SQL node. Wire the catch node to a DEBUG set to show the **complete message** and ✅ **console** logging (or pipe the caught message to file using something like node-red-contrib-flogger set to capture the entire message).

Also, can you show how you have configure this failing SQL node? Are you using a SQL QUERY String (built in a function node or the Query editor) - OR - using SQL parameters? (a screenshot would be handy)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 January 2023 10:52 UTC](https://discourse.nodered.org/t/use-statement-is-not-supported-when-inserting-into-azure-sql-paas/71036/3 "2023-01-21T10:52:32Z")

</div>

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