SplatDev.Database.MSSQLAdmin
1.0.2
dotnet add package SplatDev.Database.MSSQLAdmin --version 1.0.2
NuGet\Install-Package SplatDev.Database.MSSQLAdmin -Version 1.0.2
<PackageReference Include="SplatDev.Database.MSSQLAdmin" Version="1.0.2" />
<PackageVersion Include="SplatDev.Database.MSSQLAdmin" Version="1.0.2" />
<PackageReference Include="SplatDev.Database.MSSQLAdmin" />
paket add SplatDev.Database.MSSQLAdmin --version 1.0.2
#r "nuget: SplatDev.Database.MSSQLAdmin, 1.0.2"
#:package SplatDev.Database.MSSQLAdmin@1.0.2
#addin nuget:?package=SplatDev.Database.MSSQLAdmin&version=1.0.2
#tool nuget:?package=SplatDev.Database.MSSQLAdmin&version=1.0.2
SplatDev.Database.MSSQLAdmin
MSSQL database administration utilities for .NET, extending SplatDev.Database. Provides index maintenance, integrity checks, and size monitoring via Microsoft.Data.SqlClient.
Compatibility
| .NET | Package Version |
|---|---|
| 8.0 | 1.0.0 |
| 10.0 | 1.0.0 |
Installation
dotnet add package SplatDev.Database.MSSQLAdmin
Configuration
Add to appsettings.json:
{
"MSSQLAdmin": {
"ConnectionString": "Server=localhost;Database=MyDb;Trusted_Connection=true;TrustServerCertificate=true",
"IndexMaintenanceEnabled": true,
"IntegrityChecksEnabled": true,
"SizeMonitoringEnabled": true,
"RebuildThresholdPercent": 30.0,
"ReorganizeThresholdPercent": 10.0
}
}
| Key | Required | Default | Description |
|---|---|---|---|
ConnectionString |
Yes | — | MSSQL connection string |
IndexMaintenanceEnabled |
No | true |
Enable index rebuild/reorganize |
IntegrityChecksEnabled |
No | true |
Enable DBCC CHECKDB |
SizeMonitoringEnabled |
No | true |
Enable size/growth monitoring |
RebuildThresholdPercent |
No | 30.0 |
Fragmentation % threshold for REBUILD |
ReorganizeThresholdPercent |
No | 10.0 |
Fragmentation % threshold for REORGANIZE |
Registration
builder.Services.AddSplatDevMssqlAdmin(options =>
{
options.ConnectionString = builder.Configuration["MSSQLAdmin:ConnectionString"] ?? "";
options.RebuildThresholdPercent = 30.0f;
options.ReorganizeThresholdPercent = 10.0f;
});
Usage
public class DatabaseMaintenanceJob(
MssqlAdminService mssqlAdmin,
ILogger<DatabaseMaintenanceJob> logger)
{
public async Task RunAsync()
{
// 1. Index maintenance
var indexResult = await mssqlAdmin.MaintainIndexesAsync();
logger.LogInformation("Rebuilt {Rebuilt}, Reorganized {Reorganized}",
indexResult.RebuiltCount, indexResult.ReorganizedCount);
// 2. Integrity check
var integrity = await mssqlAdmin.CheckDatabaseIntegrityAsync();
if (!integrity.AllChecksPassed)
logger.LogWarning("DBCC CHECKDB found {Count} errors", integrity.ErrorCount);
// 3. Size monitoring
var size = await mssqlAdmin.GetDatabaseSizeInfoAsync();
logger.LogInformation("DB size: {Total} across {Count} tables",
size.TotalSizeFormatted, size.TableSizes.Count);
}
}
API
Index Maintenance
| Method | Description |
|---|---|
GetFragmentedIndexesAsync() |
Query sys.dm_db_index_physical_stats for fragmented indexes above thresholds |
MaintainIndexesAsync() |
Rebuild/reorganize all fragmented indexes + refresh statistics |
RebuildIndexAsync(schema, table, index) |
ALTER INDEX ... REBUILD for a specific index |
ReorganizeIndexAsync(schema, table, index) |
ALTER INDEX ... REORGANIZE for a specific index |
RefreshAllStatisticsAsync() |
UPDATE STATISTICS on all user tables |
Integrity Checks
| Method | Description |
|---|---|
CheckDatabaseIntegrityAsync() |
DBCC CHECKDB WITH NO_INFOMSGS, TABLERESULTS |
CheckTableIntegrityAsync(tableName) |
DBCC CHECKTABLE for a specific table |
Size Monitoring
| Method | Description |
|---|---|
GetDatabaseSizeInfoAsync() |
Database size (data + log files) and per-table sizes |
GetTableSizesAsync() |
Row counts and storage per table |
Dependencies
| Package | Purpose |
|---|---|
SplatDev.Database |
Base database abstraction library |
Microsoft.Data.SqlClient |
MSSQL ADO.NET provider |
SplatDev.Database.MSSQLAdmin — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.
Changelog
1.0.2 — 2026-08-24
Removes a dashboard screenshot that showed an error toast. It was captured against a site where this plugin's API was unreachable, so it advertised a broken dashboard. No screenshot is better than a misleading one; a replacement will be taken against a working install.
1.0.1 — 2026-08-24
Package metadata only: the listing now carries an icon and search tags, and the project and repository links point at the organisation that actually hosts this code. No code changes.
1.0.0 — 2026-08-24
This package now keeps a changelog. Earlier releases predate it and are not reconstructed here — consult the repository history for those. From this version on, every release records what changed for someone using it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Data.SqlClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- SplatDev.Database (>= 1.0.2)
-
net8.0
- Microsoft.Data.SqlClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- SplatDev.Database (>= 1.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 44 | 8/24/2026 |