get_table_dim: Get the dimensions (rows and columns) of a given table in a...

View source: R/pmap_db_utilities.R

get_table_dimR Documentation

Get the dimensions (rows and columns) of a given table in a schema

Description

Function returns a named vector of rows (number of rows) and cols (number of cols). This query uses the sys.dm_db_partition_stats table (if permission); in a live database with inserts/deletions, etc this will not be exact; if an exact count is required, or permission to access sys.dm_db_partition_stats table is not granted, the exact parameter can be set to TRUE

Usage

get_table_dim(table, schema = "dbo", engine = default_engine, exact = FALSE)

Arguments

table

a string name of table to search

schema

a string name of schema to search;default="dbo"

engine

a dbConnect connection object; by default will look in namespace for default_engine

exact

logical, default = FALSE; set to TRUE to get exact row count

Value

a vector of rows and cols

Examples

get_table_dim(problemlist',schema="dbo", engine=myconnection)
get_table_dim(problemlist',schema="dbo", engine=myconnection, exact=TRUE)

lmullany/pmap_utilities documentation built on July 30, 2023, 8:54 a.m.