-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001 s_Projects.sql
48 lines (38 loc) · 1.31 KB
/
0001 s_Projects.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
USE [KG-IMS]
GO
/****** Object: Table [dbo].[s_Projects] Script Date: 30/03/2014 11:59:05 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[s_Projects](
[ProjGUID] [uniqueidentifier] NOT NULL,
[ProjectName] [nvarchar](255) NOT NULL,
[ProjectNumber] [nvarchar](255) NULL,
[Description] [nvarchar](255) NOT NULL,
[Client] [nvarchar](255) NOT NULL,
[ClientProject] [nvarchar](255) NULL,
[LocationGUID] [uniqueidentifier] NOT NULL,
[StartDate] [datetime] NULL,
[EndDatePlanned] [datetime] NULL,
[EndDateActual] [datetime] NULL,
[Active] [bit] NOT NULL,
[ChangedBy] [nvarchar](50) NOT NULL,
[ChangedOn] [datetime] NOT NULL,
CONSTRAINT [aaaaas_Projects1_PK] PRIMARY KEY NONCLUSTERED
(
[ProjGUID] 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
ALTER TABLE [dbo].[s_Projects] WITH CHECK ADD CONSTRAINT [s_Projects_FK00] FOREIGN KEY([LocationGUID])
REFERENCES [dbo].[s_Locations] ([LocationGUID])
GO
ALTER TABLE [dbo].[s_Projects] CHECK CONSTRAINT [s_Projects_FK00]
GO
ALTER TABLE [dbo].[s_Projects] ADD DEFAULT (newid()) FOR [LocationGUID]
GO
ALTER TABLE [dbo].[s_Projects] ADD DEFAULT (1) FOR [Active]
GO
ALTER TABLE [dbo].[s_Projects] ADD DEFAULT (GETDATE()) FOR [ChangedOn]
GO