-
Notifications
You must be signed in to change notification settings - Fork 1
/
payroll.sql
139 lines (136 loc) · 8.7 KB
/
payroll.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
USE [master]
GO
/****** Object: Database [payroll] Script Date: 1/3/2016 4:09:05 PM ******/
CREATE DATABASE [payroll]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'payroll', FILENAME = N'C:\Users\Taras\payroll.mdf' , SIZE = 3264KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'payroll_log', FILENAME = N'C:\Users\Taras\payroll_log.ldf' , SIZE = 832KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [payroll].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [payroll] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [payroll] SET ANSI_NULLS OFF
GO
ALTER DATABASE [payroll] SET ANSI_PADDING OFF
GO
ALTER DATABASE [payroll] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [payroll] SET ARITHABORT OFF
GO
ALTER DATABASE [payroll] SET AUTO_CLOSE ON
GO
ALTER DATABASE [payroll] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [payroll] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [payroll] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [payroll] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [payroll] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [payroll] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [payroll] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [payroll] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [payroll] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [payroll] SET ENABLE_BROKER
GO
ALTER DATABASE [payroll] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [payroll] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [payroll] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [payroll] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [payroll] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [payroll] SET READ_COMMITTED_SNAPSHOT ON
GO
ALTER DATABASE [payroll] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [payroll] SET RECOVERY SIMPLE
GO
ALTER DATABASE [payroll] SET MULTI_USER
GO
ALTER DATABASE [payroll] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [payroll] SET DB_CHAINING OFF
GO
ALTER DATABASE [payroll] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [payroll] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
USE [payroll]
GO
/****** Object: Table [dbo].[__EFMigrationsHistory] Script Date: 1/3/2016 4:09:05 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[__EFMigrationsHistory](
[MigrationId] [nvarchar](150) NOT NULL,
[ProductVersion] [nvarchar](32) NOT NULL,
CONSTRAINT [PK_HistoryRow] PRIMARY KEY CLUSTERED
(
[MigrationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Dependent] Script Date: 1/3/2016 4:09:05 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Dependent](
[DependentID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](max) NOT NULL,
[LastName] [nvarchar](max) NOT NULL,
[MiddleName] [nvarchar](max) NULL,
[Relationship] [int] NOT NULL,
[EmployeeID] [int] NOT NULL,
CONSTRAINT [PK_Dependent] PRIMARY KEY CLUSTERED
(
[DependentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[Employee] Script Date: 1/3/2016 4:09:05 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employee](
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](max) NOT NULL,
[LastName] [nvarchar](max) NOT NULL,
[MiddleName] [nvarchar](max) NULL,
[Salary] [decimal](18, 2) NOT NULL,
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Dependent] ADD DEFAULT ((0)) FOR [EmployeeID]
GO
ALTER TABLE [dbo].[Dependent] WITH CHECK ADD CONSTRAINT [FK_Dependent_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employee] ([EmployeeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Dependent] CHECK CONSTRAINT [FK_Dependent_Employee_EmployeeID]
GO
USE [master]
GO
ALTER DATABASE [payroll] SET READ_WRITE
GO