RODBC command 'sqlQuery' has problems with table variables in t-SQL
I am using the RODBC package which I am applying on a Microsoft SQL Server 2012. Now I have discovered a phenomenon that puzzles me. If I run the following query with the RODBC command sqlQuery, then, in R, I will get back an empty data frame with the columns Country, CID, PriceID and WindID. DECLARE @tbl_IDs TABLE ( Country nvarchar(30), CID nvarchar(5), PriceID int, WindID int ) SELECT * FROM @tbl_Ids So far, everything is fine. However, if I try to write a record to the table variable and execute DECLARE @tbl_IDs TABLE ( Country nvarchar(30), CID nvarchar(5), PriceID int, WindID int )