Thor Logo dbatools

Data

Get-DbaDefaultPath

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDefaultPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Import-DbaCsv

Chrissy LeMaire (@cl), netnerds.net

Import-DbaCsv View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

New-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

New-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Creates new filegroups in SQL Server databases for custom data storage organization. Description Creates a new filegroup for the specified database(s), supporting standard row data, FileStream, and memory-optimized storage types. This is useful when you need to separate table storage across different disk drives for performance optimization, implement compliance requirements, or organize data by department or function.

Read more

New-DbaDbSequence

Adam Lancaster, github.com/lancasteradam

New-DbaDbSequence View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Creates a new sequence object in SQL Server databases with configurable properties and data types. Description Creates a new sequence object in one or more SQL Server databases, providing an alternative to IDENTITY columns for generating sequential numbers. This function allows you to configure all sequence properties including data type (system or user-defined), starting value, increment, min/max bounds, cycling behavior, and cache settings.

Read more

Remove-DbaDbData

Jess Pomfret (@jpomfret), jesspomfret.com

Remove-DbaDbData View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Truncates all user tables in specified databases to remove all data while preserving table structure. Description Removes all data from user tables by truncating each table in the specified databases. When foreign keys or views exist that would prevent truncation, the function automatically scripts them out, drops them temporarily, performs the truncation, then recreates the objects with their original definitions and permissions.

Read more

Remove-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

Remove-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Removes empty filegroups from SQL Server databases. Description Removes one or more filegroups from SQL Server databases after validating they contain no data files. This command is useful for cleaning up unused filegroups after moving data to different filegroups or during database reorganization projects. The function performs safety checks to ensure filegroups are empty before removal and provides detailed error messages if removal fails due to dependencies or constraints.

Read more

Remove-DbaDbSequence

Adam Lancaster, github.com/lancasteradam

Remove-DbaDbSequence View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Removes database sequence objects from SQL Server instances. Description Removes sequence objects from SQL Server databases, freeing up schema namespace and cleaning up unused database objects. Sequences are commonly used for generating unique numeric values and may need removal during application changes or database cleanup.

Read more

Remove-DbaDbTableData

Adam Lancaster, github.com/lancasteradam

Remove-DbaDbTableData View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Performs batch deletion of table data while controlling transaction log growth during large-scale data removal operations. Description Safely removes large amounts of table data without causing transaction log file growth issues that typically occur with single large DELETE operations. This command implements Aaron Bertrand’s chunked deletion technique (https://sqlperformance.

Read more

Select-DbaDbSequenceNextValue

Adam Lancaster, github.com/lancasteradam

Select-DbaDbSequenceNextValue View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves and increments the next value from a SQL Server sequence object. Description Executes a SELECT NEXT VALUE FOR statement against the specified sequence, which increments the sequence counter and returns the next value in the series. This is useful for testing sequence behavior, troubleshooting sequence issues, or retrieving sequence values for application logic.

Read more

Set-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

Set-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Modifies filegroup properties including default designation, read-only status, and auto-grow behavior. Description Modifies key properties of database filegroups including setting the default filegroup for new objects, changing read-only status for data archival, and configuring auto-grow behavior across all files in the filegroup. Use this when you need to restructure database storage layout, implement data archival strategies, or optimize file growth patterns.

Read more
Page 2 of 3