SQL Server, not able to use GUI bulk insert

Hi Retool Team,

I'm tring to dump the result from the changeset to the SQL Server.

I have no issue reading the data from the SQL Server and can insert individual records using Insert in SQL mode. But if I want to use the GUI mode, it shows up this strange error

  • statusCode:422
  • error:"Unprocessable Entity"
  • message:"Login failed for user 'XXXX@XXXX.ORG'."

This is the same error I would encounter if I turn off the 'connect using Windows Auth' when setting up the SQL Server connection in Resource. So I wonder if the GUI mode is hornoring the 'Windows Auth' option.

Btw, i use the Retool self-host 3.58.0 and Windows Auth is the only way my organization allows to access the database.

What should I do to bulk insert Retool records to SQL?

I'm not strictly have to use GUI mode, but need a way to insert multiple records at a time.

Similar to:

insert into XXX
  select * from {{formatDataAsArray(YYYY.data)}}

But it seems Retool doesn't allow me to crossover the js data and the sql.

Bump. Anyone have an idea?

Hi @zelterNN,

Thanks for reaching out! I don't see any known bugs here, but it does seem like an auth issue. Do you happen to know if this was working for you on past versions?

For the second query, we prevent selecting from dynamic values as a security measure described here. You could disable prepared statements to test the query, but ideally we find a solution with prepared statements enabled.

It would help to test a hardcoded query - in GUI and SQL mode - to see if you can get any write queries to run successfully

I also recommend running a get permissions request in SQL mode to determine what permissions the Retool connection has

Hi @Tess,

I have never had a luck with the GUI mode, even on several previous versions during my test. My workaround was to change the way user interact with the data to insert one record at a time or to initiate a workflow to loop thru the changeset on multiple records. However, those are just workarounds and not ideal (slow for workflow specially).

I can successfully write data in SQL mode with hardcoded query. The 'login failed' error only appears when I use GUI mode.

I'm thinking about the 'Windows Auth' because this is the same error if I turn off the 'Connect using Windows Auth' in Resource and test the connection.

Can someone in your team have a check if this attribute is inherented properly under GUI mode?

1 Like

Yes, checking internally! Thanks for testing the sql mode query