dbStorage | R Documentation |
Get storage size of tables in a database.
dbStorage(channel, total = TRUE, used = FALSE, unused = FALSE)
channel |
an RODBC connection. |
total |
whether to calculate total storage size. |
used |
whether to calculate used storage size. |
unused |
whether to calculate unused storage size. |
Data frame containing the following columns:
Name |
name of table/view. |
Schema |
database schema. |
Type |
type of table/view. |
Rows |
number of rows. |
Cols |
number of columns. |
In addition, any of the following columns, depending on which of
total
, used
, and unused
are TRUE
:
TotalKB |
total storage size. |
UsedKB |
used storage size. |
UnusedKB |
unused storage size. |
Based on https://stackoverflow.com/questions/7892334.
sqlQuery
is the underlying function used to query
sys.tables
, sys.indexes
, sys.partitions
,
sys.allocation_units
, and sys.schemas
.
dbOverview
shows the dimensions of tables/views and the first
column names, and dbTime
shows the time when tables/views were
created and last modified.
object.size
is the base function to return the storage size of
objects inside the R workspace.
MSSQL-package
gives an overview of the package.
## Not run:
con <- odbcConnect("myDatabase")
dbOverview(con)
dbOverview(con, dim=FALSE, peek=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.