I've arrived here via the Issues submission page of the dplyr Github repo. With respect to creating temporary tables in MSSQL via dplyr/dbplyr, I am not sure if there is a bug or if I am using the wrong code. Here are the details. I can successfully connect to my MSSQL database via:
con <- DBI::dbConnect(odbc::odbc(), "MyMSSQLDatabase")
I can query tables, join tables, and collect the results. Fine, now I want to create a temporary table. I use:
q1 <- tbl(con, "TableInDB") %>%
select(ColumnOfInterest) %>%
compute(name="#TemporaryTableInDB")
I receive the following error:
Error: <SQL> 'CREATE TEMPORARY TABLE "#TemporaryTableInDB" AS SELECT "ColumnOfInterest" AS "ColumnOfInterest"
FROM (SELECT "ColumnOfInterest" AS "ColumnOfInterest"
FROM "TableInDB") "nalrdixbop"'
nanodbc/nanodbc.cpp:1587: 42000: [Microsoft][ODBC SQL Server Driver][SQL Server]Unknown object type 'TEMPORARY' used in a CREATE, DROP, or ALTER statement.
I can recognize that the generated SQL code is incorrect for creating temporary tables in MSSQL. So, is this a currently unsupported feature or am I doing this incorrectly?
Thanks,
Donnie