db_write_table2: db_write_table2

View source: R/db_write_table2.R

db_write_table2R Documentation

db_write_table2

Description

Write table to database

Usage

db_write_table2(
  data,
  con,
  schema,
  table,
  fields = NULL,
  to_nvarchar = TRUE,
  overwrite = TRUE,
  append = !overwrite,
  unique_cols = everything(),
  to_utf16 = TRUE,
  temporary = FALSE,
  logging = TRUE,
  batch_rows = 1000,
  bulk = FALSE
)

Arguments

data

Data.

con

Connection string.

schema

Schema name.

table

Table name.

fields

Named vector of column names and datatypes. If null, then automatic fetch by DBI::dbDataType.

to_nvarchar

Convert varchar datatype to nvarchar for easier encoding.

overwrite

Overwrite table.

append

Append table.

unique_cols

Columns, which makes appended data unique. You can use tidyselect styled helpers like starts_with(). Default: everything().

to_utf16

Convert to UTF-16LE, which is required for proper Microsoft SQL Server encoding.

batch_rows

Number of rows for a batch. Default: 1000. Suggestion: 10000.

bulk

Not yet implemented. Allows bulk insert using bcp.exe tool.


JouniVatanen/Jmisc documentation built on Feb. 3, 2023, 12:28 a.m.