Issue to obtain data from SQL Server in spanish


I have a SQL Server database, in spanish, and I want to obtain the results from SELECT *

To do this, I connect R with the database using odbc library.

After that, I do this:

dbSendQuery(con,"SELECT * FROM [database].[dbo].[]")

This returns me an error: std::bad_alloc

But if I do this:

dbSendQuery(con,"SELECT Id FROM [database].[dbo].[]")

then I obtain good resutls

I have seen that only when varchar type of columsn names are involved in the query, then the error is shown, so I think that schema could be the responsible of this issue.

What can I do to dont have this error? The schema is “dbo”



Maybe the resolution for this issue can help: