ConvertTo-DbaDataTable View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Converts PowerShell objects into .NET DataTable objects for bulk SQL Server operations
Description Converts PowerShell objects into .NET DataTable objects with proper column types and database-compatible data formatting. This is essential for bulk operations like importing data into SQL Server tables using Write-DbaDataTable or other bulk insert methods.
The function automatically detects and converts data types to SQL Server-compatible formats, handling special dbatools types like DbaSize (file sizes) and DbaTimeSpan objects.
Copy-DbaDbTableData View Source Simone Bizzotto (@niphlod) Windows, Linux, macOS Synopsis Streams table data between SQL Server instances using high-performance bulk copy operations.
Description Copies data between SQL Server tables using SQL Bulk Copy for maximum performance and minimal memory usage.
Unlike Invoke-DbaQuery and Write-DbaDbTableData which buffer entire table contents in memory, this function streams data directly from source to destination.
This approach prevents memory exhaustion when copying large tables and provides the fastest data transfer method available.
Copy-DbaDbViewData View Source Stephen Swan (@jaxnoth) Windows, Linux, macOS Synopsis Copies data from SQL Server views to destination tables using high-performance bulk copy operations.
Description Extracts data from SQL Server views and bulk copies it to destination tables, either on the same instance or across different servers.
Uses SqlBulkCopy for optimal performance when migrating view data, materializing view results, or creating data snapshots from complex views.
Supports custom queries against views, identity preservation, constraint checking, and automatic destination table creation.
Get-DbaDbFile View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS Synopsis Retrieves comprehensive database file information including size, growth, I/O statistics, and storage details.
Description Retrieves detailed information about database files (data and log files) from SQL Server instances using direct T-SQL queries for optimal performance. This function provides comprehensive file metadata including current size, used space, growth settings, I/O statistics, and volume free space information that DBAs need for capacity planning, performance analysis, and storage management.
Get-DbaDbFileGroup View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves filegroup configuration and storage details from SQL Server databases
Description Retrieves detailed filegroup information from one or more databases, including filegroup type, size, and configuration details. This function helps DBAs analyze database storage organization, plan storage capacity, and document database structure for compliance or migration planning. Returns filegroup objects that can be filtered by database or specific filegroup names, making it useful for targeted storage analysis and troubleshooting performance issues related to data distribution.
Get-DbaDbFileGrowth View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves database file auto-growth settings and maximum size limits
Description Retrieves auto-growth configuration for data and log files across SQL Server databases, including growth type (percentage or fixed MB), growth increment values, and maximum size limits. This function helps DBAs quickly identify databases with problematic growth settings like percentage-based growth on large files, unlimited growth configurations, or insufficient growth increments that could cause performance issues during auto-growth events.
Chrissy LeMaire (@cl), netnerds.net | Andreas Jordan (@JordanOrdix), ordix.de
Get-DbaDbFileMapping View Source Chrissy LeMaire (@cl), netnerds.net , Andreas Jordan (@JordanOrdix), ordix.de Windows, Linux, macOS Synopsis Creates file mapping hashtable from existing database for use in restore operations
Description Extracts the logical-to-physical file name mappings from an existing database and returns them in a hashtable format compatible with Restore-DbaDatabase. This eliminates the need to manually specify file paths when restoring databases to different servers or locations. The function reads both data files and log files from the database’s file groups and creates a complete mapping that preserves the original file structure during restore operations.
Get-DbaDbSequence View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS Synopsis Retrieves SQL Server sequence objects and their configuration details from specified databases.
Description Retrieves sequence objects from SQL Server databases, returning detailed information about each sequence including data type, start value, increment value, and schema location. Sequences provide a flexible alternative to IDENTITY columns for generating sequential numeric values, allowing values to be shared across multiple tables and offering more control over numbering behavior.
Get-DbaDefaultPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves default file paths for SQL Server data, log, backup, and error log directories
Description Retrieves the default directory paths that SQL Server uses for new database files, transaction logs, backups, and error logs. This information is essential for capacity planning, automated database provisioning, and understanding where SQL Server will place files when no explicit path is specified. The function uses multiple fallback methods to determine these paths, including server properties, system queries, and examining existing system databases when standard properties are unavailable.
Import-DbaCsv View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Imports CSV files into SQL Server tables using high-performance bulk copy operations.
Description Import-DbaCsv uses .NET’s SqlBulkCopy class to efficiently load CSV data into SQL Server tables, handling files of any size from small datasets to multi-gigabyte imports. The function wraps the entire operation in a transaction, so any failure or interruption rolls back all changes automatically.
When the target table doesn’t exist, you can use -AutoCreateTable to create it on the fly with basic nvarchar(max) columns.