Skip to content

Commit deb34a6

Browse files
authoredOct 9, 2021
Merge pull request #196 from claymachinegun/mssql_schema_dump
Claymachinegun|MSSQLSchemaDumper|MsSQL schema scripting tool
2 parents 2048990 + 8569af7 commit deb34a6

File tree

8 files changed

+752
-0
lines changed

8 files changed

+752
-0
lines changed
 

‎MSSQLSchemaDump/.gitignore

+433
Large diffs are not rendered by default.

‎MSSQLSchemaDump/App.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

‎MSSQLSchemaDump/Program.cs

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
using Microsoft.SqlServer.Management.Smo;
2+
using Microsoft.SqlServer.Management.Common;
3+
using Newtonsoft.Json;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.IO;
7+
using System.Linq;
8+
using System.Collections.Specialized;
9+
10+
namespace db_dumper {
11+
12+
class DBTask {
13+
public string Login { get; set; }
14+
public string Password { get; set; }
15+
public string Server { get; set; }
16+
public string DB { get; set; }
17+
public string OutputFolder { get; set; }
18+
}
19+
20+
class Program {
21+
static void DumpObjects<T>(SmoCollectionBase objects, string prompt, ScriptingOptions options) where T : NamedSmoObject, IScriptable {
22+
var isSystemObject = typeof(T).GetProperties().FirstOrDefault(x => x.Name == "IsSystemObject");
23+
foreach (T sec in objects) {
24+
if (isSystemObject != null && (bool)isSystemObject.GetValue(sec)) continue;
25+
StringCollection sc = sec.Script(options);
26+
Console.WriteLine(prompt + sec.Name);
27+
}
28+
}
29+
static void DumpTask(string fpath) {
30+
DBTask task = new DBTask();
31+
try {
32+
string data = File.ReadAllText(fpath);
33+
task = JsonConvert.DeserializeObject<DBTask>(data);
34+
} catch (FileNotFoundException e) {
35+
Console.WriteLine("Cannot open task file : " + fpath);
36+
return;
37+
}
38+
if (!Directory.Exists(task.OutputFolder)) Directory.CreateDirectory(task.OutputFolder);
39+
40+
ServerConnection connection = new ServerConnection(task.Server) { LoginSecure = false, Login = task.Login, Password = task.Password, ConnectTimeout = 3 };
41+
42+
Server sqlserv = new Server(connection);
43+
try {
44+
Console.WriteLine("Connected server version:" + sqlserv.Information.Version);
45+
} catch (Exception e) {
46+
Console.WriteLine("Cannot connect to server: " + task.Server);
47+
Console.WriteLine(e.Message);
48+
return;
49+
}
50+
Database database = null;
51+
try {
52+
database = sqlserv.Databases[task.DB];
53+
} catch (Exception e) {
54+
Console.WriteLine("Cannot find database");
55+
Console.WriteLine(e.Message);
56+
return;
57+
}
58+
string footprint = DateTime.Now.ToString("ddMMyyyy-HHmm");
59+
string outfile = task.OutputFolder + "/" + footprint + "_" + task.DB + "_schema" + ".sql";
60+
61+
ScriptingOptions scripterOpts = new ScriptingOptions();
62+
scripterOpts.FileName = outfile;
63+
scripterOpts.AppendToFile = true;
64+
scripterOpts.ScriptForCreateDrop = false;
65+
scripterOpts.DriForeignKeys = true;
66+
scripterOpts.Indexes = true;
67+
scripterOpts.DriAllConstraints = true;
68+
scripterOpts.DriPrimaryKey = true;
69+
70+
DumpObjects<Login>(sqlserv.Logins, "Login ", scripterOpts);
71+
DumpObjects<User>(database.Users, "User ", scripterOpts);
72+
73+
StringCollection sc1 = database.Script(scripterOpts);
74+
Console.WriteLine("Database " + database.Name);
75+
76+
DumpObjects<PartitionFunction>(database.PartitionFunctions, "Partition function ", scripterOpts);
77+
DumpObjects<PartitionScheme>(database.PartitionSchemes, "Partition scheme ", scripterOpts);
78+
DumpObjects<Table>(database.Tables, "Table ", scripterOpts);
79+
DumpObjects<View>(database.Views, "View ", scripterOpts);
80+
DumpObjects<UserDefinedType>(database.UserDefinedTypes, "User defined type ", scripterOpts);
81+
DumpObjects<UserDefinedTableType>(database.UserDefinedTableTypes, "User defined table type ", scripterOpts);
82+
DumpObjects<StoredProcedure>(database.StoredProcedures, "Procedure ", scripterOpts);
83+
DumpObjects<UserDefinedFunction>(database.UserDefinedFunctions, "Function ", scripterOpts);
84+
85+
connection.Disconnect();
86+
Console.WriteLine("Done");
87+
}
88+
static void Main(string[] args) {
89+
if (args.Count() == 0) {
90+
Console.WriteLine("MSSQL dumper 0.1");
91+
return;
92+
}
93+
foreach (string fpath in args) {
94+
DumpTask(fpath);
95+
}
96+
Console.ReadLine();
97+
}
98+
}
99+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// Общие сведения об этой сборке предоставляются следующим набором
6+
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
7+
// связанные со сборкой.
8+
[assembly: AssemblyTitle("db_dumper")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("db_dumper")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
18+
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
19+
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
20+
[assembly: ComVisible(false)]
21+
22+
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
23+
[assembly: Guid("8686426b-434b-4a2c-be8e-e7b35362704d")]
24+
25+
// Сведения о версии сборки состоят из следующих четырех значений:
26+
//
27+
// Основной номер версии
28+
// Дополнительный номер версии
29+
// Номер сборки
30+
// Редакция
31+
//
32+
// Можно задать все значения или принять номер сборки и номер редакции по умолчанию.
33+
// используя "*", как показано ниже:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎MSSQLSchemaDump/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# MSSQL schema scripting tool
2+
Simple tool to dump your mssql database schema just in 100 lines of code by @claymachinegun.
3+
## How to use it
4+
1. Build App
5+
2. Create json file containing your credentials to database (just like in example_task.json)
6+
3. Run app passing task file as parameter `db_dumper.exe example_task.json`
7+
4. Feel free to play around with code if you miss some functions

‎MSSQLSchemaDump/db_dumper.csproj

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{8686426B-434B-4A2C-BE8E-E7B35362704D}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>db_dumper</RootNamespace>
10+
<AssemblyName>db_dumper</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>x64</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="Microsoft.SqlServer.AzureStorageEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
39+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.AzureStorageEnum.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Microsoft.SqlServer.BatchParserClient, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
42+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.BatchParserClient.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Microsoft.SqlServer.ConnectionInfo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
45+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.ConnectionInfo.dll</HintPath>
46+
</Reference>
47+
<Reference Include="Microsoft.SqlServer.ConnectionInfoExtended, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
48+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.ConnectionInfoExtended.dll</HintPath>
49+
</Reference>
50+
<Reference Include="Microsoft.SqlServer.Diagnostics.Strace, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
51+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Diagnostics.Strace.dll</HintPath>
52+
</Reference>
53+
<Reference Include="Microsoft.SqlServer.Dmf, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Dmf.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Microsoft.SqlServer.Dmf.Common, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Dmf.Common.dll</HintPath>
58+
</Reference>
59+
<Reference Include="Microsoft.SqlServer.Management.Collector, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
60+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.Collector.dll</HintPath>
61+
</Reference>
62+
<Reference Include="Microsoft.SqlServer.Management.CollectorEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
63+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.CollectorEnum.dll</HintPath>
64+
</Reference>
65+
<Reference Include="Microsoft.SqlServer.Management.RegisteredServers, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
66+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.RegisteredServers.dll</HintPath>
67+
</Reference>
68+
<Reference Include="Microsoft.SqlServer.Management.Sdk.Sfc, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
69+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.Sdk.Sfc.dll</HintPath>
70+
</Reference>
71+
<Reference Include="Microsoft.SqlServer.Management.SqlParser, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
72+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.SqlParser.dll</HintPath>
73+
</Reference>
74+
<Reference Include="Microsoft.SqlServer.Management.Utility, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
75+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.Utility.dll</HintPath>
76+
</Reference>
77+
<Reference Include="Microsoft.SqlServer.Management.UtilityEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
78+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.UtilityEnum.dll</HintPath>
79+
</Reference>
80+
<Reference Include="Microsoft.SqlServer.Management.XEvent, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
81+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.XEvent.dll</HintPath>
82+
</Reference>
83+
<Reference Include="Microsoft.SqlServer.Management.XEventDbScoped, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
84+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.XEventDbScoped.dll</HintPath>
85+
</Reference>
86+
<Reference Include="Microsoft.SqlServer.Management.XEventDbScopedEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
87+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.XEventDbScopedEnum.dll</HintPath>
88+
</Reference>
89+
<Reference Include="Microsoft.SqlServer.Management.XEventEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
90+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Management.XEventEnum.dll</HintPath>
91+
</Reference>
92+
<Reference Include="Microsoft.SqlServer.PolicyEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
93+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.PolicyEnum.dll</HintPath>
94+
</Reference>
95+
<Reference Include="Microsoft.SqlServer.RegSvrEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
96+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.RegSvrEnum.dll</HintPath>
97+
</Reference>
98+
<Reference Include="Microsoft.SqlServer.ServiceBrokerEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
99+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.ServiceBrokerEnum.dll</HintPath>
100+
</Reference>
101+
<Reference Include="Microsoft.SqlServer.Smo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
102+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Smo.dll</HintPath>
103+
</Reference>
104+
<Reference Include="Microsoft.SqlServer.SmoExtended, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
105+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SmoExtended.dll</HintPath>
106+
</Reference>
107+
<Reference Include="Microsoft.SqlServer.SqlClrProvider, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
108+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SqlClrProvider.dll</HintPath>
109+
</Reference>
110+
<Reference Include="Microsoft.SqlServer.SqlEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
111+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SqlEnum.dll</HintPath>
112+
</Reference>
113+
<Reference Include="Microsoft.SqlServer.SqlTDiagm, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
114+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SqlTDiagm.dll</HintPath>
115+
</Reference>
116+
<Reference Include="Microsoft.SqlServer.SqlWmiManagement, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
117+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SqlWmiManagement.dll</HintPath>
118+
</Reference>
119+
<Reference Include="Microsoft.SqlServer.SString, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
120+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.SString.dll</HintPath>
121+
</Reference>
122+
<Reference Include="Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
123+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.Types.dll</HintPath>
124+
</Reference>
125+
<Reference Include="Microsoft.SqlServer.WmiEnum, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
126+
<HintPath>..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\lib\net40\Microsoft.SqlServer.WmiEnum.dll</HintPath>
127+
</Reference>
128+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
129+
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
130+
</Reference>
131+
<Reference Include="System" />
132+
<Reference Include="System.Core" />
133+
<Reference Include="System.Xml.Linq" />
134+
<Reference Include="System.Data.DataSetExtensions" />
135+
<Reference Include="Microsoft.CSharp" />
136+
<Reference Include="System.Data" />
137+
<Reference Include="System.Net.Http" />
138+
<Reference Include="System.Xml" />
139+
</ItemGroup>
140+
<ItemGroup>
141+
<Compile Include="Program.cs" />
142+
<Compile Include="Properties\AssemblyInfo.cs" />
143+
</ItemGroup>
144+
<ItemGroup>
145+
<None Include="App.config" />
146+
<None Include="packages.config" />
147+
</ItemGroup>
148+
<ItemGroup>
149+
<WCFMetadata Include="Connected Services\" />
150+
</ItemGroup>
151+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
152+
<Import Project="..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\build\net40\Microsoft.SqlServer.SqlManagementObjects.targets" Condition="Exists('..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\build\net40\Microsoft.SqlServer.SqlManagementObjects.targets')" />
153+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
154+
<PropertyGroup>
155+
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
156+
</PropertyGroup>
157+
<Error Condition="!Exists('..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\build\net40\Microsoft.SqlServer.SqlManagementObjects.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.SqlServer.SqlManagementObjects.140.17283.0\build\net40\Microsoft.SqlServer.SqlManagementObjects.targets'))" />
158+
</Target>
159+
</Project>

‎MSSQLSchemaDump/example_task.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"Login":"admin",
3+
"Password":"P@s$w0rD",
4+
"Server":"127.0.0.1",
5+
"DB":"YourDB",
6+
"OutputFolder":"E:/backups/db/"
7+
}

‎MSSQLSchemaDump/packages.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.SqlServer.SqlManagementObjects" version="140.17283.0" targetFramework="net461" />
4+
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net461" />
5+
</packages>

0 commit comments

Comments
 (0)
Please sign in to comment.