Add project files.
This commit is contained in:
72
EmployeeDb/EmployeeDb.sqlproj
Normal file
72
EmployeeDb/EmployeeDb.sqlproj
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<Name>EmployeeDb</Name>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>4.1</ProjectVersion>
|
||||
<ProjectGuid>{affde419-691d-4d1c-aa0c-0c7af9a4ff69}</ProjectGuid>
|
||||
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
|
||||
<OutputType>Database</OutputType>
|
||||
<RootPath>
|
||||
</RootPath>
|
||||
<RootNamespace>EmployeeDb</RootNamespace>
|
||||
<AssemblyName>EmployeeDb</AssemblyName>
|
||||
<ModelCollation>1033, CI</ModelCollation>
|
||||
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
|
||||
<DeployToDatabase>True</DeployToDatabase>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetLanguage>CS</TargetLanguage>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<SqlServerVerification>False</SqlServerVerification>
|
||||
<IncludeCompositeObjects>True</IncludeCompositeObjects>
|
||||
<TargetDatabaseSet>True</TargetDatabaseSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
|
||||
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
|
||||
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
|
||||
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
|
||||
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties" />
|
||||
<Folder Include="Tables" />
|
||||
<Folder Include="StoredProcedures" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Build Include="Tables\Employee.sql" />
|
||||
<Build Include="StoredProcedures\spEmployee_GetAll.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="EmployeeDb.publish.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PostDeploy Include="Script.PostDeployment1.sql" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
22
EmployeeDb/Script.PostDeployment1.sql
Normal file
22
EmployeeDb/Script.PostDeployment1.sql
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
if not exists(select * from dbo.Employee)
|
||||
begin
|
||||
insert into dbo.Employee (FirstName, LastName, Title)
|
||||
values
|
||||
('John', 'Doe', 'Manager'),
|
||||
('Jane', 'Doe', 'Assistant Manager'),
|
||||
('Bob', 'Smith', 'Clerk'),
|
||||
('Sally', 'Smith', 'Clerk'),
|
||||
('Tom', 'Jones', 'Clerk')
|
||||
end
|
||||
go
|
||||
6
EmployeeDb/StoredProcedures/spEmployee_GetAll.sql
Normal file
6
EmployeeDb/StoredProcedures/spEmployee_GetAll.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE PROCEDURE [dbo].[spEmployee_GetAll]
|
||||
AS
|
||||
begin
|
||||
select [Id], [FirstName], [LastName], [Title]
|
||||
from Employee
|
||||
end
|
||||
7
EmployeeDb/Tables/Employee.sql
Normal file
7
EmployeeDb/Tables/Employee.sql
Normal file
@ -0,0 +1,7 @@
|
||||
CREATE TABLE [dbo].[Employee]
|
||||
(
|
||||
[Id] INT NOT NULL PRIMARY KEY Identity(1,1),
|
||||
[FirstName] NVARCHAR(50) NOT NULL,
|
||||
[LastName] NVARCHAR(50) NOT NULL,
|
||||
[Title] NVARCHAR(50) NOT NULL,
|
||||
)
|
||||
Reference in New Issue
Block a user