Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello Dataiku community,
I am trying to select a column from a table with a SQL query. But my column name is composed of a special character such as '?'.
So I tried to select it with these methods: table.[columname_?] and table."columname_?" (methods used for SQL) . But it didn't work...
Have you faced this problem?
Thanks a lot.
Operating system used: Microsoft windows
What error are you seeing exactly in the SQL Recipe when you try to use square brackets?
Also, what version of SQL servers are you running on?
Have also tried to SET QUOTED_IDENTIFIER ON ?
The error on the validation is "Query failed: A processing error "Invalid column name 'Opco/Central_null'." occurred." The name of the column is Opco/Central_? , and it was between square brackets.
The version is : Microsoft SQL Server 2016 (SP2-CU15) (KB4577775) - 13.0.5850.14 (X64) Sep 17 2020 22:12:45 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ).
I tried with SET QUOTED_IDENTIFIER ON but no change...
Thank you for your help.
Maybe a quick&dirty solution can be to be less specific with selecting, as removing unwanted data is a lot easier. The Like operator works with column names when you select them from information_schema.columns . I have not tested this, possibly you need to specify the table. Just my two cents.