-
Notifications
You must be signed in to change notification settings - Fork 75
/
import.bat
101 lines (89 loc) · 4.68 KB
/
import.bat
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
@echo off
@echo --Importing SNOMED CT into MS SQL DB> import.sql
@echo TRUNCATE TABLE curr_extendedmaprefset_f;>> import.sql
@echo TRUNCATE TABLE curr_simplemaprefset_f;>> import.sql
@echo TRUNCATE TABLE curr_attributevaluerefset_f;>> import.sql
@echo TRUNCATE TABLE curr_simplerefset_f;>> import.sql
@echo TRUNCATE TABLE curr_associationrefset_f;>> import.sql
@echo TRUNCATE TABLE curr_langrefset_f;>> import.sql
@echo TRUNCATE TABLE curr_stated_relationship_f;>> import.sql
@echo TRUNCATE TABLE curr_relationship_f;>> import.sql
@echo TRUNCATE TABLE curr_description_f;>> import.sql
@echo TRUNCATE TABLE curr_concept_f;>> import.sql
IF NOT EXIST Full\Terminology\sct2_Concept_Full_INT_* (
@echo Cannot find Full\Terminology\sct2_Concept_Full_INT_*
EXIT /B 1
)
for /r %%i in (Full\Terminology\sct2_Concept_Full_INT_*) do (
@echo BULK INSERT curr_concept_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Terminology\sct2_Description_Full-en_INT_* (
@echo Cannot find Full\Terminology\sct2_Description_Full-en_INT_
EXIT /B 1
)
for /r %%i in (Full\Terminology\sct2_Description_Full-en_INT_*) do (
@echo BULK INSERT curr_description_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Terminology\sct2_TextDefinition_Full-en_INT_* (
@echo Cannot find Full\Terminology\sct2_TextDefinition_Full-en_INT_*
EXIT /B 1
)
for /r %%i in (Full\Terminology\sct2_TextDefinition_Full-en_INT_*) do (
@echo BULK INSERT curr_textdefinition_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Terminology\sct2_Relationship_Full_INT_* (
@echo Cannot find Full\Terminology\sct2_Relationship_Full_INT_*
EXIT /B 1
)
for /r %%i in (Full\Terminology\sct2_Relationship_Full_INT_*) do (
@echo BULK INSERT curr_relationship_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Terminology\sct2_StatedRelationship_Full_INT_* (
@echo Cannot find Full\Terminology\sct2_StatedRelationship_Full_INT_*
EXIT /B 1
)
for /r %%i in (Full\Terminology\sct2_StatedRelationship_Full_INT_*) do (
@echo BULK INSERT curr_stated_relationship_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Language\der2_cRefset_LanguageFull-en_INT_* (
@echo Cannot find Full\Refset\Language\der2_cRefset_LanguageFull-en_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Language\der2_cRefset_LanguageFull-en_INT_*) do (
@echo BULK INSERT curr_langrefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Content\der2_cRefset_AssociationReferenceFull_INT_* (
@echo Cannot find Full\Refset\Content\der2_cRefset_AssociationReferenceFull_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Content\der2_cRefset_AssociationReferenceFull_INT_*) do (
@echo BULK INSERT curr_associationrefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Content\der2_Refset_SimpleFull_INT_* (
@echo Cannot find Full\Refset\Content\der2_Refset_SimpleFull_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Content\der2_Refset_SimpleFull_INT_*) do (
@echo BULK INSERT curr_simplerefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Content\der2_cRefset_AttributeValueFull_INT_* (
@echo Cannot find Full\Refset\Content\der2_cRefset_AttributeValueFull_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Content\der2_cRefset_AttributeValueFull_INT_*) do (
@echo BULK INSERT curr_attributevaluerefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Map\der2_sRefset_SimpleMapFull_INT_* (
@echo Cannot find Full\Refset\Map\der2_sRefset_SimpleMapFull_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Map\der2_sRefset_SimpleMapFull_INT_*) do (
@echo BULK INSERT curr_simplemaprefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)
IF NOT EXIST Full\Refset\Map\der2_iisssccRefset_ExtendedMapFull_INT_* (
@echo Cannot find Full\Refset\Map\der2_iisssccRefset_ExtendedMapFull_INT_*
EXIT /B 1
)
for /r %%i in (Full\Refset\Map\der2_iisssccRefset_ExtendedMapFull_INT_*) do (
@echo BULK INSERT curr_extendedmaprefset_f FROM '%%i' WITH (FIRSTROW = 2, FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', TABLOCK^); >>import.sql
)