Skip to content

Commit cbe0495

Browse files
committed
Initital Commit
1 parent fe48367 commit cbe0495

40 files changed

Lines changed: 1414 additions & 2 deletions

File tree

Constraints/Creation.sql

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
================================================================================================================
3+
================================================================================================================
4+
================================================================================================================
5+
================================================================================================================
6+
================================================================================================================
7+
Constraint Creation
8+
================================================================================================================
9+
================================================================================================================
10+
================================================================================================================
11+
================================================================================================================
12+
================================================================================================================
13+
*/
14+
15+
/* EXAMPLE *
16+
17+
IF NOT EXISTS ( SELECT TOP 1 *
18+
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
19+
WHERE CONSTRAINT_NAME = '[FKNAME]' )
20+
BEGIN
21+
ALTER TABLE [Table]
22+
--WITH CHECK
23+
ADD CONSTRAINT [FKName]
24+
FOREIGN KEY ([FKID]) REFERENCES [PKTable] ([PK])
25+
END
26+
GO
27+
28+
*/
29+
PRINT 'CONSTRAINT: Creation Start(' + convert(varchar(30),GetDate(),109) + ')'
30+
GO
31+
32+
33+
34+
GO
35+
PRINT 'CONSTRAINT: Creation End(' + convert(varchar(30),GetDate(),109) + ')'

Constraints/Removal.sql

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
================================================================================================================
3+
================================================================================================================
4+
================================================================================================================
5+
================================================================================================================
6+
================================================================================================================
7+
Constraint Removal
8+
================================================================================================================
9+
================================================================================================================
10+
================================================================================================================
11+
================================================================================================================
12+
================================================================================================================
13+
*/
14+
15+
/* EXAMPLE *
16+
17+
IF EXISTS ( SELECT TOP 1 *
18+
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
19+
WHERE CONSTRAINT_NAME = '[FKNAME]' )
20+
BEGIN
21+
ALTER TABLE [Table]
22+
DROP CONSTRAINT [FKName]
23+
END
24+
25+
*/
26+
PRINT 'CONSTRAINT: Removal Start(' + convert(varchar(30),GetDate(),109) + ')'
27+
GO
28+
29+
30+
31+
32+
GO
33+
PRINT 'CONSTRAINT: Removal End(' + convert(varchar(30),GetDate(),109) + ')'
34+
35+

Functions/Create/.svn/all-wcprops

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 79
4+
/svn/concentrium/!svn/ver/194/Concentrium/SQL%20SVN%20Template/Functions/Create
5+
END

Functions/Create/.svn/entries

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
10
2+
3+
dir
4+
201
5+
https://devserver/svn/concentrium/Concentrium/SQL%20SVN%20Template/Functions/Create
6+
https://devserver/svn/concentrium
7+
8+
9+
10+
2009-10-08T14:35:29.216827Z
11+
194
12+
kmaglio
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
385b9a34-cea8-f24e-9f39-01a6e36a8bf3
28+

Functions/Drop/.svn/all-wcprops

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 77
4+
/svn/concentrium/!svn/ver/194/Concentrium/SQL%20SVN%20Template/Functions/Drop
5+
END

Functions/Drop/.svn/entries

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
10
2+
3+
dir
4+
201
5+
https://devserver/svn/concentrium/Concentrium/SQL%20SVN%20Template/Functions/Drop
6+
https://devserver/svn/concentrium
7+
8+
9+
10+
2009-10-08T14:35:29.216827Z
11+
194
12+
kmaglio
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
385b9a34-cea8-f24e-9f39-01a6e36a8bf3
28+

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ e.g. vMyView -- will have two scripts, one in the Create folder and one in the D
1515

1616
There are some example scripts in the Tables and Views folder to get you started
1717

18-
There is also a Script Creation folder which provides a windows command-line batch file, to build an Release.sql file containing the merged single script run - for all objects you create.
19-
18+
There is also a Script Creation folder which provides a windows command-line batch file, to build an Release.sql file containing the merged single script run - for all objects you create.

ScriptCreation/Combine.bat

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@echo Off
2+
3+
set resultfile="Release\Release.sql"
4+
5+
if exist "%resultfile%" del "%resultfile%"
6+
7+
8+
Echo Header
9+
type "header.sql","spacer.sql" >> "%resultfile%"
10+
11+
12+
echo Triggers
13+
for /f "tokens=*" %%i in ('dir /b "..\Triggers\Drop\*.sql"') do type "..\Triggers\Drop\%%i","spacer.sql" >> "%resultfile%"
14+
15+
16+
echo Functions
17+
for /f "tokens=*" %%i in ('dir /b "..\Functions\Drop\*.sql"') do type "..\Functions\Drop\%%i","spacer.sql" >> "%resultfile%"
18+
19+
20+
echo View creation
21+
for /f "tokens=*" %%i in ('dir /b "..\Views\Drop\*.sql"') do type "..\Views\Drop\%%i","spacer.sql" >> "%resultfile%"
22+
23+
24+
echo StoredProcedures
25+
for /f "tokens=*" %%i in ('dir /b "..\StoredProcedures\Drop\*.sql"') do type "..\StoredProcedures\Drop\%%i","spacer.sql" >> "%resultfile%"
26+
27+
28+
Echo Remove Constraints
29+
type "..\Constraints\Removal.sql","spacer.sql" >> "%resultfile%"
30+
31+
32+
Echo Tables\DB Managed
33+
for /f "tokens=*" %%i in ('dir /b "..\Tables\DB Managed\*.sql"') do type "..\Tables\DB Managed\%%i","spacer.sql" >> "%resultfile%"
34+
35+
Echo Tables\DB Managed Populations
36+
type "..\Tables\DB Managed Populations\Populations.sql","spacer.sql" >> "%resultfile%"
37+
38+
39+
Echo Tables\User Managed
40+
for /f "tokens=*" %%i in ('dir /b "..\Tables\User Managed\*.sql"') do type "..\Tables\User Managed\%%i","spacer.sql" >> "%resultfile%"
41+
42+
43+
Echo Tables\USER Managed Populations
44+
type "..\Tables\USER Managed Populations\Populations.sql","spacer.sql" >> "%resultfile%"
45+
46+
47+
Echo Add Constraints
48+
type "..\Constraints\Creation.sql","spacer.sql" >> "%resultfile%"
49+
50+
51+
echo StoredProcedures
52+
for /f "tokens=*" %%i in ('dir /b "..\StoredProcedures\Create\*.sql"') do type "..\StoredProcedures\Create\%%i","spacer.sql" >> "%resultfile%"
53+
54+
55+
echo View creation
56+
for /f "tokens=*" %%i in ('dir /b "..\Views\Create\*.sql"') do type "..\Views\Create\%%i","spacer.sql" >> "%resultfile%"
57+
58+
59+
echo Functions
60+
for /f "tokens=*" %%i in ('dir /b "..\Functions\Create\*.sql"') do type "..\Functions\Create\%%i","spacer.sql" >> "%resultfile%"
61+
62+
63+
echo Triggers
64+
for /f "tokens=*" %%i in ('dir /b "..\Triggers\Create\*.sql"') do type "..\Triggers\Create\%%i","spacer.sql" >> "%resultfile%"
65+
66+
67+
echo Footer
68+
type "footer.sql","spacer.sql" >> "%resultfile%"
69+
70+
Echo Scripting Complete
71+
Pause
72+
73+
Release\Release.sql
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 85
4+
/svn/concentrium/!svn/ver/197/Concentrium/SQL%20SVN%20Template/ScriptCreation/Release
5+
END
6+
Release.sql
7+
K 25
8+
svn:wc:ra_dav:version-url
9+
V 97
10+
/svn/concentrium/!svn/ver/197/Concentrium/SQL%20SVN%20Template/ScriptCreation/Release/Release.sql
11+
END
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
10
2+
3+
dir
4+
201
5+
https://devserver/svn/concentrium/Concentrium/SQL%20SVN%20Template/ScriptCreation/Release
6+
https://devserver/svn/concentrium
7+
8+
9+
10+
2009-10-15T15:54:37.035297Z
11+
197
12+
kmaglio
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
385b9a34-cea8-f24e-9f39-01a6e36a8bf3
28+
29+
Release.sql
30+
file
31+
32+
33+
34+
35+
2009-10-28T03:38:59.170000Z
36+
5c6266653786eb7ce71cd968039b245b
37+
2009-10-15T15:54:37.035297Z
38+
197
39+
kmaglio
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
12087
62+

0 commit comments

Comments
 (0)