Allow Custom Table In GUI version of SQL query due to formatting errors

Currently for the mssql connector, the GUI SQL editor will throw an error when the schema name contains a dot. For example, selecting the table 'dbo.ODS_Retool.Prospective_Secondary_Investments' from the dropdown is possible but the query fails because the table is parsed as 'insert into [dbo].[ODS_Retool].[Prospective_Secondary_Investments]'.

While the obvious solution is to rename the schema, would it be possible to type in the table name or use javascript while using the GUI option?

do you get the same error if you write out the sql statement in SQL mode instead of GUI?

No, because I am able to manually format the table to be [dbo.ODS_Retool].[Prospective_Secondary_Investments]

:thinking: Could you try using this setting on the resource (and then use the dynamic database name on the query)? It can only be enabled by an admin:

image

I'm not sure if that will help as a workaround, so let me know!

I don't think this is possible. however, if you click over to SQL mode:

INSERT INTO 'dbo.ODS_Retool.Prospective_Secondary_Investments' (column1_str, column2_int, column3_date, column4_date_tz, column4_enum...)
  VALUES ('test str', 0, '1987-06-22', '2024-06-12 00:00:00.000+0000', 'enum_value')
    RETURNING * AS new_row;

i 100% don't blame ya if you prefer to never touch SQL and would rather not try it the manual way (it actually may not work either, i don't know though i've never tried using a table w . in the name)

1 Like