Dernière activité 1727480794

Script to automatically create databases: PlanetDB_2800, SharedDB_2800, CollectionDB_2800, and LogDB_2800

script.sql Brut
1-- Create PlanetDB_2800
2IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'PlanetDB_2800')
3BEGIN
4 PRINT 'Creating PlanetDB_2800...'
5 CREATE DATABASE PlanetDB_2800
6 PRINT 'PlanetDB_2800 created successfully.'
7END
8ELSE
9BEGIN
10 PRINT 'PlanetDB_2800 already exists.'
11END
12GO
13
14-- Create SharedDB_2800
15IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'SharedDB_2800')
16BEGIN
17 PRINT 'Creating SharedDB_2800...'
18 CREATE DATABASE SharedDB_2800
19 PRINT 'SharedDB_2800 created successfully.'
20END
21ELSE
22BEGIN
23 PRINT 'SharedDB_2800 already exists.'
24END
25GO
26
27-- Create CollectionDB_2800
28IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'CollectionDB_2800')
29BEGIN
30 PRINT 'Creating CollectionDB_2800...'
31 CREATE DATABASE CollectionDB_2800
32 PRINT 'CollectionDB_2800 created successfully.'
33END
34ELSE
35BEGIN
36 PRINT 'CollectionDB_2800 already exists.'
37END
38GO
39
40-- Create LogDB_2800
41IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = 'LogDB_2800')
42BEGIN
43 PRINT 'Creating LogDB_2800...'
44 CREATE DATABASE LogDB_2800
45 PRINT 'LogDB_2800 created successfully.'
46END
47ELSE
48BEGIN
49 PRINT 'LogDB_2800 already exists.'
50END
51GO
52
53-- End of script