-
Notifications
You must be signed in to change notification settings - Fork 3
/
connTest.js
61 lines (51 loc) · 1.77 KB
/
connTest.js
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
//sql({
// query: `
// SELECT NAME
// FROM sys.objects where type='u' and name like 'WCSPROGRAMS_KoboBnsAnswer%'
// `,
// });
sql({
query:`Select WCSPROGRAMS_ProjectID, WCSPROGRAMS_ProjectName from WCSPROGRAMS_Project`
});
// sql({
// query:
// `Select C.*, (Select definition From sys.default_constraints Where object_id = C.object_id) As dk_definition,
// (Select definition From sys.check_constraints Where object_id = C.object_id) As ck_definition,
// (Select name From sys.objects Where object_id = D.referenced_object_id) As fk_table,
// (Select name From sys.columns Where column_id = D.parent_column_id And object_id = D.parent_object_id) As fk_col
// From sys.objects As C
// Left Join (Select * From sys.foreign_key_columns) As D On D.constraint_object_id = C.object_id
// Where C.parent_object_id = (Select object_id From sys.objects Where type = 'U'
// And name = 'WCSPROGRAMS_ProjectAnnualDataPlanDataSetSurveyType');`
// });*/
// sql({
// query: `INSERT INTO WCSPROGRAMS_DataTool (WCSPROGRAMS_DataToolName, WCSPROGRAMS_DataToolExtCode,
// UserID_CR, UserID_LM, IsForCollect, IsForManage, IsForAnalyze)
// VALUES ('Audio video interview', 'audio_video_interview', '0', '0', '1', '0', '0');
// `,
// });
//alterState(state=>{
//console.log(JSON.stringify(state.references, null, 2));
//return state;
//})
// sql({
// query: `
// SELECT *
// FROM INFORMATION_SCHEMA.COLUMNS
// WHERE TABLE_NAME = 'WCSPROGRAMS_KoboNgrtNgrtanswer'`,
// });
// sql({
// query: `
// SELECT WCSPROGRAMS_ProjectAnnualDataPlanID
// FROM WCSPROGRAMS_ProjectAnnualDataPlan
// WHERE DataSetUUIDID = '86587778'`,
// });
// sql({
// query: `
// SELECT @@VERSION;
// `,
// });
alterState(state => {
console.log(JSON.stringify(state.references, null, 2));
return state;
});