-
Notifications
You must be signed in to change notification settings - Fork 8
/
all-tracking-sql.html
189 lines (175 loc) · 6.64 KB
/
all-tracking-sql.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<script runat="server">
Platform.Load("Core", "1.1.1");
try {
var queryDef1 = {
Name: "MC_job_data_view",
CustomerKey: "MC_job_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_job_data_view",
CustomerKey: "MC_job_data_view"
},
QueryText: "select * from _Job"
};
var status_queryDef1 = QueryDefinition.Add(queryDef1);
var queryDef2 = {
Name: "MC_sent_data_view",
CustomerKey: "MC_sent_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_sent_data_view",
CustomerKey: "MC_sent_data_view"
},
QueryText: "select * from _Sent"
};
var status_queryDef2 = QueryDefinition.Add(queryDef2);
var queryDef3 = {
Name: "MC_click_data_view",
CustomerKey: "MC_click_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_click_data_view",
CustomerKey: "MC_click_data_view"
},
QueryText: "select * from _Click"
};
var status_queryDef3 = QueryDefinition.Add(queryDef3);
var queryDef4 = {
Name: "MC_complaint_data_view",
CustomerKey: "MC_complaint_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_complaint_data_view",
CustomerKey: "MC_complaint_data_view"
},
QueryText: "select * from _Complaint"
};
var status_queryDef4 = QueryDefinition.Add(queryDef4);
var queryDef5 = {
Name: "MC_open_data_view",
CustomerKey: "MC_open_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_open_data_view",
CustomerKey: "MC_open_data_view"
},
QueryText: "select * from _Open"
};
var status_queryDef5 = QueryDefinition.Add(queryDef5);
var queryDef6 = {
Name: "MC_subscribers_data_view",
CustomerKey: "MC_subscribers_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_subscribers_data_view",
CustomerKey: "MC_subscribers_data_view"
},
QueryText: "select * from _Subscribers"
};
var status_queryDef6 = QueryDefinition.Add(queryDef6);
var queryDef7 = {
Name: "MC_subscribers_sms_data_view",
CustomerKey: "MC_subscribers_sms_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_subscribers_sms_data_view",
CustomerKey: "MC_subscribers_sms_data_view"
},
QueryText: "select * from _SubscriberSMS"
};
var status_queryDef7 = QueryDefinition.Add(queryDef7);
var queryDef8 = {
Name: "MC_undeliverable_sms_data_view",
CustomerKey: "MC_undeliverable_sms_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_undeliverable_sms_data_view",
CustomerKey: "MC_undeliverable_sms_data_view"
},
QueryText: "select * from _UndeliverableSms"
};
var status_queryDef8 = QueryDefinition.Add(queryDef8);
var queryDef9 = {
Name: "MC_journey_data_view",
CustomerKey: "MC_journey_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_journey_data_view",
CustomerKey: "MC_journey_data_view"
},
QueryText: "select * from _Journey"
};
var status_queryDef9 = QueryDefinition.Add(queryDef9);
var queryDef10 = {
Name: "MC_journey_activity_data_view",
CustomerKey: "MC_journey_activity_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_journey_activity_data_view",
CustomerKey: "MC_journey_activity_data_view"
},
QueryText: "select * from _JourneyActivity"
};
var status_queryDef10 = QueryDefinition.Add(queryDef10);
var queryDef11 = {
Name: "MC_bounce_data_view",
CustomerKey: "MC_bounce_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_bounce_data_view",
CustomerKey: "MC_bounce_data_view"
},
QueryText: "select * from _Bounce"
};
var status_queryDef11 = QueryDefinition.Add(queryDef11);
var queryDef12 = {
Name: "MC_push_address_data_view",
CustomerKey: "MC_push_address_data_view",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_push_address_data_view",
CustomerKey: "MC_push_address_data_view"
},
QueryText: "select _CreatedBy as CreatedBy, _PlatformVersion as PlatformVersion, _CreatedDate as CreatedDate, _OptOutStatusID as OptOutStatusID, _OptInStatusID as OptInStatusID, _Alias as Alias, _ProviderToken as ProviderToken, _Status as Status, _DeviceID as DeviceID, _Badge as Badge, _IsHonorDST as IsHonorDST, _LocationEnabled as LocationEnabled, _ZipCode as ZipCode, _SourceObjectId as SourceObjectId, _City as City, _Platform as Platform, _TimeZone as TimeZone, _State as State, _HardwareId as HardwareId, _OptOutDate as OptOutDate, _UTCOffset as UTCOffset, _DeviceType as DeviceType, _FirstName as FirstName, _ModifiedBy as ModifiedBy, _OptInMethodID as OptInMethodID, _Device as Device, _Channel as Channel, _OptInDate as OptInDate, _APID as APID, _SystemToken as SystemToken, _OptOutMethodID as OptOutMethodID, _ModifiedDate as ModifiedDate, _LastName as LastName, _ContactID as ContactID, _Source as Source from _PushAddress"
};
var status_queryDef12 = QueryDefinition.Add(queryDef12);
var queryDef13 = {
Name: "MC_sms_message_tracking",
CustomerKey: "MC_sms_message_tracking",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_sms_message_tracking",
CustomerKey: "MC_sms_message_tracking"
},
QueryText: "select * from _smsmessagetracking"
};
var status_queryDef13 = QueryDefinition.Add(queryDef13);
var queryDef14 = {
Name: "MC_sms_subscription_log",
CustomerKey: "MC_sms_subscription_log",
TargetUpdateType: "Overwrite",
TargetType: "DE",
Target: {
Name: "MC_sms_subscription_log",
CustomerKey: "MC_sms_subscription_log"
},
QueryText: "select * from _SMSSubscriptionLog"
};
var status_queryDef14 = QueryDefinition.Add(queryDef14);
} catch (ex) {
Write("error message: " + ex);
}
</script>