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 Incorrect syntax Exception #6976
Comments
@dkalaria Looks like we are generating a SQL query that is not valid on SQL Server. Can you share the GraphQL query for which you see this error? |
@0x777 Here is the query i am trying to run. Its the bare minimum
|
@dkalaria Do you have any permissions defined? |
@0x777 I am able to connect to the server and also track the tables. Just not able to query it. What kind of permission would restrict the execution of a query? |
@dkalaria do you have any row select permissions on that table by any chance? Since those permissions filter the rows of the table, they translate into a Could you also try using the Thanks in advance! |
Sure, On analyze button, I see |
Argl, sorry about that, that was to be expected. 😞 In the meantime, would you mind exporting your metadata (go to |
@nicuveo No worries.
|
Having a similar issue with alpha.11 here's my error and my query looks similar to the OP's.
here's my metadata
|
very similar error when trying to make a simple query from the hasura api explorer: query MyQuery {
test1 {
foooooo
}
} {
"errors": [
{
"extensions": {
"internal": {
"tag": "unsuccessful_return_code",
"contents": [
"odbc_SQLExecDirectW",
-1,
"[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'WITH'.[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon."
]
},
"path": "$",
"code": "unexpected"
},
"message": "sql server exception"
}
]
} if I go in the raw sql page and try to make the same query: select foooooo from test1 it works as expected
|
@0x777 will do. It might be Tuesday at the earliest that I'm able to share it as I'm away from my work computer for the next few days. |
Hey folks, can you let us know the version of sql server you are on by running this query: SELECT @@VERSION; We suspect that the older versions of SQL Server 2016 do not support We've reverted the sql generation changes introduced in
|
@0x777 here's the MySQL version I'm working with currently. I'll go try that build right now.
|
Update: so far the |
@0x777 Quick question. The build you commented with appears to have solved the above problem and I have things working. What's the recommendation for continued development? Should I just roll with this build you provided or will there be changes inside of alpha.12 to reflect this issue? Thanks for your time and help! |
I can confirm that using |
I just tested OPENJSON (@JSON) in mine and I didn't get the hasura error, but I did have to alter the database compatibility to get OPENJSON to work. That being said, I was getting an invalid object error and not Incorrect Syntax Exception.
|
Hey folks, with SELECT name, compatibility_level FROM sys.databases; If it is lower than |
I'm closing this issue as this should be resolved with |
Meant to update this and say that everything has been working on my end since beta.1 Thanks! |
Tnks man. Its solved my problem with subscription errors. |
Hello,
I really appreciate the graphql-engine project and i am really excited to try it out. I am trying to run the project on docker for MS Sql Server. I have a remote database server and I was able to connect to the server using the connection string:
Driver={ODBC Driver 17 for SQL Server}; Server=remoteurl,1433;Database=tempdb;Uid=sa;pwd=password
and I am usinghasura/graphql-engine:v2.0.0-alpha.11
version.When I try to query the object after tracking it, I get following error:
I am using the following docker-compose file:
Is there any configuration that I am missing? I expect since the graphql-engine is running inside docker I don't have to install it on my local. Do I need to add any config for SQL server in the docker-compose yml file? i am using connect database option to add database source to a remote SQL server instance.
Appreciate it!
The text was updated successfully, but these errors were encountered: