-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0017 OPS_Rpt_Types.sql
51 lines (49 loc) · 3.23 KB
/
0017 OPS_Rpt_Types.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
/*
Tuesday, 1 April 20147:46:50 PM
User:
Server: MALH-PC\MSSQLSERVER2012
Database: KG-IMS
Application:
*/
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.OPS_Rpt_Types
(
RptTypeGUID uniqueidentifier NOT NULL,
Name nvarchar(50) NOT NULL,
SeedDate date NOT NULL,
Frequency nvarchar(50) NOT NULL,
Active bit NOT NULL,
ChangedBy nvarchar(50) NOT NULL,
ChangedOn datetime NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.OPS_Rpt_Types ADD CONSTRAINT
DF_OPS_Rpt_Types_RptTypeGUID DEFAULT (newid()) FOR RptTypeGUID
GO
ALTER TABLE dbo.OPS_Rpt_Types ADD CONSTRAINT
DF_OPS_Rpt_Types_Active DEFAULT ((1)) FOR Active
GO
ALTER TABLE dbo.OPS_Rpt_Types ADD CONSTRAINT
DF_OPS_Rpt_Types_ChangedOn DEFAULT (getdate()) FOR ChangedOn
GO
ALTER TABLE dbo.OPS_Rpt_Types ADD CONSTRAINT
PK_OPS_Rpt_Types PRIMARY KEY CLUSTERED
(
RptTypeGUID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE dbo.OPS_Rpt_Types SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
select Has_Perms_By_Name(N'dbo.OPS_Rpt_Types', 'Object', 'ALTER') as ALT_Per, Has_Perms_By_Name(N'dbo.OPS_Rpt_Types', 'Object', 'VIEW DEFINITION') as View_def_Per, Has_Perms_By_Name(N'dbo.OPS_Rpt_Types', 'Object', 'CONTROL') as Contr_Per