Executing Query Issue in SQL Server

Hello everyone I am having a completely weird issue while executing query in SQL Server from R with odbc

when I select column1 and column 2, there is no error
same when I just select column 3

dbFetch(dbSendQuery(my_connector,"SELECT column1, column2 FROM MYTABLE"))
dbFetch(dbSendQuery(my_connector,"SELECT column3 FROM MYTABLE"))

but when I try to select the three columns or when I try to select another column with column3 I get this error

dbFetch(dbSendQuery(my_connector,"SELECT column1, column2, column3 FROM MYTABLE"))
dbFetch(dbSendQuery(my_connector,"SELECT column1, column3 FROM MYTABLE"))
dbFetch(dbSendQuery(my_connector,"SELECT column2, column3 FROM MYTABLE"))

If anyone has ever encountered the same issue I really need your help

you provide 2 sets of examples
at the top 2 lines of working code, and underneath 3 of failing code.

but the last example of both sets is the same command , is there a mistake here ?

also it looks likes the error message screenshot is cropped . ODBC Driver 13 for ...[truncated]
as errors are text, its best to paste them into the forum and format them as you have done with your code examples; regards

Hello @nirgrahamuk , thank you for answering,

you are right the last example of the first set is also a failing code
This is what I meant as second example of working code

dbFetch(dbSendQuery(my_connector,"SELECT column3 FROM MYTABLE"))

But for the error, I am really getting a cropped error in the screen

Error in result_fetch(res@ptr, n) : **
** nanodbc/nanodbc.cpp:2966: 00000: [Microsoft][ODBC Driver 13 for S

The lack of stack trace is a real pain point

Seems to be this issue

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.