New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server requires SET QUOTED_IDENTIFIER ON #209
Comments
|
Can't replicate anymore. Do the |
|
Just FYI, I'm running into this with both Your solution here worked for me. Maybe put that in the docs? Make it an option somewhere? |
|
@edgararuiz maybe we should add this suggestion to the known issues at https://db.rstudio.com/databases/microsoft-sql-server/? |
|
I had overlooked that page when debugging. I think I need to test:
sql_translate_env.JDBCConnection <- dbplyr:::`sql_translate_env.Microsoft
SQL Server` sql_select.JDBCConnection <- dbplyr:::`sql_select.Microsoft SQL
Server`
…On Wed, Sep 5, 2018 at 8:23 AM Jim Hester ***@***.***> wrote:
@edgararuiz <https://github.com/edgararuiz> maybe we should add this
suggestion to the known issues at
https://db.rstudio.com/databases/microsoft-sql-server/?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#209 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHvnwwkwXlMlS0GDZ_cGsHLv3agOZXFks5uX8JNgaJpZM4WHLYB>
.
|
|
I think you all knew this, but I didn't: changing the dplyr options above does not change the quoting, which is a different issue. To make dplyr work with my SQL Server I need the I think adding it to the db.rstudio.com makes sense to me. Note this however: It appears that RJDBC does not play well with DBI::dbExecute. |
|
@CerebralMastication , so you had to do this in order to get it to work? If so, we can add that to the page. |
|
Yes, when using RJDBC on SQL Server that worked for me. When using |
|
however neither FWIW, I am not admin on my SQL Server box so I have no idea if this is generally applicable to other SQL Server instances or some idiosyncrasy with our configuration. |
|
Oh ok, so this a work around for a very specific case. Are you using FreeTDS, as stated by @krlmlr at the top of this issue? If not, what driver are you using? and, are you using the same driver for both |
|
I am using the Simba driver for |
|
Ok, we may also need to capture your package levels. Can you load |
|
Happy to: |
So based on this I think you should really be setting this in the connection attributes / your DSN settings, not as a separate statement after connecting. Also the native ODBC driver on windows sets this by default, so this would only be something you need to configure when using freetds drivers; likely the Microsoft linux Driver and Simba's drivers already set this (which is likely why I never ran into this problem). |
|
My use case is that I'm on Linux/Mac but I need Windows Authentication. The MSFT drivers do not support Windows Authentication on Linux/Mac. So I am forced to use Simba for |
|
Looks like neither the Simba ODBC driver nor the jtds RDBC driver support turning on QUOTED_IDENTIFIER at the connection string or DSN. It's no big deal for me to add the correct R code to set that after I do my connection. But it really should be documented somewhere for the next fool like me to stumble upon. |
|
FreeTDS ODBC driver turns on by default the |
Also supported by FreeTDS driver. |
|
You should be able to set @edgararuiz |
for proper handling of quotes:
Otherwise,
"can't be used to delimit identifiers.Reference: https://docs.microsoft.com/en-us/sql/t-sql/statements/set-quoted-identifier-transact-sql?view=sql-server-2017.
This happens with a connection via FreeTDS, the reference to
SET ANSI_DEFAULTS ON(a superset ofQUOTED_IDENTIFIER) claims that this is set automatically for ODBC connections.I wonder if we can/should be issuing this by default for connections to SQL Server, or if this is an upstream issue.
The text was updated successfully, but these errors were encountered: