DataJuggler.SQLSnapshot 8.0.0

dotnet add package DataJuggler.SQLSnapshot --version 8.0.0
NuGet\Install-Package DataJuggler.SQLSnapshot -Version 8.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DataJuggler.SQLSnapshot" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DataJuggler.SQLSnapshot --version 8.0.0
#r "nuget: DataJuggler.SQLSnapshot, 8.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DataJuggler.SQLSnapshot as a Cake Addin
#addin nuget:?package=DataJuggler.SQLSnapshot&version=8.0.0

// Install DataJuggler.SQLSnapshot as a Cake Tool
#tool nuget:?package=DataJuggler.SQLSnapshot&version=8.0.0

SQLSnapshot

DataJuggler.SQLSnapshot allows you to export a snapshot of a SQL Server database including all data rows to Excel with a few lines of code.

Optional: Pass in a list of table names you wish to exclude from the export.

There is now a desktop (WinForms) example that demonstrates this project https://github.com/DataJuggler/SQLSnapshotDesktop

Video<br> https://youtu.be/dOA_8EJ_xWA

<img src=https://github.com/DataJuggler/SharedRepo/blob/master/Shared/Images/SQLSnapshot.png width=540 height=360>

Pass in a connectionstring and a path to save.

using DataJuggler.SQLSnapshot;

// Set a connectionstring - make sure to include Encrypt=False as shown below
string connectionString = @"Data Source=ServerName\SQLExpress;Initial Catalog=DataJuggler;Integrated Security=True;Encrypt=False;";

// Set the export path
string exportPath = @"c:\Temp\DataJugglerExport.xlsx";

// export the result (one line of code. Is this useful, let me know by starring this project please).
SQLExportResult result = SQLExcelBridge.ExportSnapshot(connectionString, exportPath);

11.17.2023: Updated to .NET 8.

This project has been updated to the latest .NET version, .NET 8.

The file name for the Excel file will be saved and combined with a partial guid, so it will be unique in a folder.

This project combines two Nuget packages of mine:

  1. DataJuggler.Net8 - Which reads the database schema
  2. DataJuggler.Excelerate - Writes to Excel

Known Issues:

None at this time.

Fixed issues

  1. (Fixed in 1.0.8, Excelerate version 7.2.9) Exclude Tables bug has been fixed.
  2. (Fixed in 1.0.9 Excelerate version 7.2.10) Fixed format date columns as dates.

Future updates and features may include:

  1. Ability to only write changes since last snapshot
  2. Export database schema for tables and fields
  3. Consolidate data to update a Test or Dev server with production data
  4. I am looking at creating a callback delegate so client apps can create a progress bar or display current status or operation.

Completed Features

  1. Pass in a list of tables to exclude (completed in version 7.2.9)

The reason I created this project is SQL Backups are great for data protection, however this requires restoring the entire database to lookup values. There are also times I need to discover when data changed to help determine when a new bug was introduced.

If you have any problems, please create an issue and I welcome any feedback as to if you think this project is useful or ways it can be improved. I am considering building a Windows Service to create a commercial product out of this with more robust features.

News

8.13.2023: DataJuggler.Excelerate was updated because DataJuggler.UltimateHelper was updated.

7.24.2023:

ExcelerateWinApp has been updated with improvements for saving worksheets.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
8.0.0 216 11/17/2023
1.1.2 135 8/14/2023
1.1.1 121 7/24/2023
1.1.0 115 7/17/2023
1.0.11 142 4/10/2023
1.0.10 150 4/10/2023
1.0.9 155 4/5/2023
1.0.8 163 4/5/2023
1.0.7 167 4/2/2023
1.0.6 170 4/2/2023
1.0.5 170 4/2/2023
1.0.4 176 4/1/2023
1.0.2 184 3/28/2023
1.0.1 168 3/28/2023
1.0.0 189 3/28/2023

11.17.2023: This project has been updated to .NET 8.

7.24.2023: NuGet package DataJuggler.Excelerate has been updated.

This project combines two of my Nuget packages, DataJuggler.Net7 for database schema reading
and DataJuggler.Excelerate for Excel exporting.

Here is an 18 minute video to show 3 lines of code. Will remake a new video soon.
https://youtu.be/dOA_8EJ_xWA

7.16.2023: I updated several NuGet packages including DataJuggler.Cryptography, DataJuggler.Net7 and
DataJuggler.UltimateHelper.

4.11.2023: I added a new delegate ProgressStatusCallback to DataJuggler.Net7 that can be passed into the
ExportSnapshot method to receive callbacks during long operations.

Update 4.2.2023 B
v1.0.7: I moved the List<string> ignoreTables parameter to be the first optional parameter.
I figure now is the time to make breaking changes, and it makes the most sense.

Updates 4.2.2023 v1.0.5:
DataJuggler.Excelerate was updated and I am attempting to set date columns as Dates in Excel.

Hopefull this works. Will update this once I test.