forked from microsoftgraph/dataconnect-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_crm_control_tables.sql
56 lines (49 loc) · 1.31 KB
/
create_crm_control_tables.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
--------------------------- Control Table for CRM Copy Process -------------------------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF OBJECT_ID ('dbo.crm_ctrl') IS NOT NULL
DROP TABLE [dbo].[crm_ctrl]
CREATE TABLE [dbo].[crm_ctrl]
(
[ProcessId] INT IDENTITY(1,1),
[SourceSystem] [NVARCHAR](128) NOT NULL,
[SourceSchemaName] [NVARCHAR](36) NOT NULL,
[SourceTableName] [NVARCHAR](100) NOT NULL,
[SourceLastModifiedColumn] [NVARCHAR](36) NOT NULL,
[SourceMergeKey] [NVARCHAR](36) NOT NULL,
[SinkSchemaName] [NVARCHAR](36) NOT NULL,
[SinkTableName] [NVARCHAR](100) NOT NULL,
[SinkMergeKey] [NVARCHAR](36) NOT NULL,
[IsActive] BIT NOT NULL,
[LastUpdate] [DATETIME2](3) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
---------------------------- Table for CRM Table Mappings -----------------------------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF OBJECT_ID ('dbo.crm_mapping') IS NOT NULL
DROP TABLE [dbo].[crm_mapping]
CREATE TABLE [dbo].[crm_mapping]
(
[MappingId] INT IDENTITY(1,1) NOT NULL,
[ProcessId] [INT],
[SourceColumn] [NVARCHAR](100) NULL,
[SinkColumn] [NVARCHAR](100) NULL,
[Type] [NVARCHAR](36) NULL,
[PhysicalType] [NVARCHAR](36) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO