table_duplicate_f: copy a (smaller) SQL table from server to another

View source: R/table_duplicate.R

table_duplicate_fR Documentation

copy a (smaller) SQL table from server to another

Description

Made for smaller table, e.g., reference tables

Usage

table_duplicate_f(
  conn_from,
  conn_to,
  server_to,
  db_to,
  table_df = data.frame(),
  from_schema = NULL,
  from_table = NULL,
  to_schema = NULL,
  to_table = NULL,
  to_table_prefix = NULL,
  confirm_tables = T,
  delete_table = F,
  delete_table_suffix = "_dupe_table_to_delete",
  table_structure_only = F
)

Arguments

conn_from

Name of the connection to the FROM SQL database

conn_to

Name of the connection to the TO SQL database

server_to

Name of the server/odbc for the TO SQL database. ***IMPORTANT*** For any Azure based duplication, there must be a keyring with a service name that matches the server_to parameter

db_to

Name of the TO SQL database

table_df

data.frame that can hold a list of FROM schema, FROM tables (required), TO schema, and TO tables

from_schema

Variable for FROM schema for either a single table or can populate any missing data in the table_df from_schema column

from_table

Variable for FROM table for duplicating a single table

to_schema

Variable for TO schema for either a single table or can populate any missing data in the table_df to_schema column, can be blank and use the from_schema on TO database

to_table

Variable for TO table for either a single table or can populate any missing data in the table_df to_table column, can be blank and use the from_table on TO database

to_table_prefix

Variable of a prefix to be added before the TO table name

confirm_tables

If TRUE, will require user confirm the list of tables being duplicated

delete_table

If TRUE, will delete old TO tables, if FALSE, will rename old TO tables

delete_table_suffix

Variable of a suffix to be added after the name of old TO tables

table_structure_only

If TRUE, will only copy the table structure of old TO new tables

Details

Plans for future improvement ...

Value

None

Author(s)

Jeremy Whitehurst, 2024-05-01

Examples

 ## Not run: 
  # ENTER EXAMPLES HERE
 
## End(Not run)
 

PHSKC-APDE/apde documentation built on April 14, 2025, 10:46 a.m.