-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Description
I am getting an error when trying to create temporary tables using compute and copy_to with Microsoft SQL Server connection. As shown below, I can create non-temporary tables.
library(tidyverse)
my_con <-
DBI::dbConnect(
odbc::odbc(),
Driver = "SQL Server",
Server = ".\\SQLExpress",
Database = "temp",
Trusted_Connection = "True"
)
iris %>%
copy_to(my_con, ., "iris")
#> Created a temporary table named: #iris
#> Error in result_insert_dataframe(rs@ptr, values, batch_rows): nanodbc/nanodbc.cpp:1617: 42000: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#iris'. [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
my_table <- iris %>%
copy_to(my_con, ., "iris", temporary = FALSE)
my_table %>%
compute()
#> Created a temporary table named: #dbplyr_001
#> Error: nanodbc/nanodbc.cpp:1617: 42S02: [Microsoft][ODBC SQL Server Driver][SQL Server]Table '#dbplyr_001' does not exist.
#> <SQL> 'UPDATE STATISTICS "#dbplyr_001"'Created on 2020-04-29 by the reprex package (v0.3.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels