I have a SQL Server database, in spanish, and I want to obtain the results from SELECT * table.name
To do this, I connect R with the database using odbc library.
After that, I do this:
dbSendQuery(con,"SELECT * FROM [database].[dbo].[table.name]")
This returns me an error: std::bad_alloc
But if I do this:
dbSendQuery(con,"SELECT Id FROM [database].[dbo].[table.name]")
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”