BlitzSqlExtract2SeedData 1.1.2
dotnet add package BlitzSqlExtract2SeedData --version 1.1.2
NuGet\Install-Package BlitzSqlExtract2SeedData -Version 1.1.2
<PackageReference Include="BlitzSqlExtract2SeedData" Version="1.1.2" />
paket add BlitzSqlExtract2SeedData --version 1.1.2
#r "nuget: BlitzSqlExtract2SeedData, 1.1.2"
// Install BlitzSqlExtract2SeedData as a Cake Addin
#addin nuget:?package=BlitzSqlExtract2SeedData&version=1.1.2
// Install BlitzSqlExtract2SeedData as a Cake Tool
#tool nuget:?package=BlitzSqlExtract2SeedData&version=1.1.2
SqlExtract2SeedData
An update to a little utility to extract tables in SQL Server to SQL Files for Seed Data
.NET Core 3.1 Runtime or SDK Required
Usage
BlitzSqlExtract2SeedData 1.1.2 Copyright (c) 2020 Blitzkrieg Software
-v, --verbose Set output to verbose messages.
-c, --connectstring Required. Connection String
-t, --table Required. SQL Table To Extract Data From
-o, --orderby (optional) Order By Clause in the form of "order by column1, column2"
-w, --where (optional) Where Clausein the form of "where (column1 = 3)"
-n, --ntop (optional) Top N Rows
-a, --ascsv (optional) Emit CSV instead
--help Display this help screen.
--version Display version information.
Pro Tip: please use quotes around strings like table names, clauses, etc.
Sample Command
BlitzSqlExtract2SeedData -c "Server=.\sqlexpress;Database=Bicycle;Trusted_Connection=True;" -t "store.product"
Table notation
Tables can be in the form of:
table
⇒[dbo].[table]
[table]
⇒[dbo].[table]
schema.table
⇒[schema].[table]
[schema].[table]
⇒[schema].[table]
"table"
⇒[dbo].[table]
"[table]"
⇒[dbo].[table]
"schema.table"
⇒[schema].[table]
"[schema].[table]"
⇒[schema].[table]
Where and Order By
You can use where
and/or order by
clauses, just like you would do in SQL server.
Please supply full valid sql clauses such as:
BlitzSqlExtract2SeedData -c "Server=.\sqlexpress;Database=Bicycle;Trusted_Connection=True;" -t "store.product" -w "Where [IsActive] = 1" -o "Order By [CustomerId]"
Top Modifier
By default, all rows are returned. If -n
is specified a Top N
clause is added, the rows returned are controlled by the where
and order by
clauses if supplied, and will be returned in "natural" order otherwise.
BlitzSqlExtract2SeedData -c "Server=.\sqlexpress;Database=Bicycle;Trusted_Connection=True;" -t "store.product" -n 20
or
BlitzSqlExtract2SeedData -c "Server=.\sqlexpress;Database=Bicycle;Trusted_Connection=True;" -t "store.product" -w "Where [IsActive] = 1" -o "Order By [CustomerId]" -n 100
As CSV
Using the flag -a
will create a CSV file with TAB delimiters, instead of a seed data SQL Script.
To open it in Excel or Open Office, use the file, open mechanism so that you will be given a chance to set the settings in the text import wizard:
- Field Delimiter (Tab \t)
- Row Delimiter (CRLF \r\n)
About Me
- Stuart Williams
- Cloud/DevOps Practice Lead
- Magenic Technologies Inc., Office of the CTO
- E-Mail: stuartw@magenic.com
- Blog: http://blitzkriegsoftware.net/Blog
- LinkedIn: http://lnkd.in/P35kVT
- YouTube: https://www.youtube.com/user/spookdejur1962/videos
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- BlitzkriegSoftware.AdoSqlHelper (>= 1.0.0)
- CommandLineParser (>= 2.8.0)
- System.Data.SqlClient (>= 4.8.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 |
---|
Updated for the latest versions of Microsoft SQL Server