Schreiben erster Tabellen.
This commit is contained in:
parent
7415379d03
commit
b1383770ff
9 changed files with 413 additions and 35 deletions
BIN
SQL/1_tables/0 tblTemplate.txt
Normal file
BIN
SQL/1_tables/0 tblTemplate.txt
Normal file
Binary file not shown.
54
SQL/1_tables/tblAlignments.sql
Normal file
54
SQL/1_tables/tblAlignments.sql
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblAlignments.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblAlignments anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblAlignments')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblAlignments>'
|
||||||
|
|
||||||
|
-- drop table tblAlignments
|
||||||
|
create table tblAlignments (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblAlignments] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [description] nvarchar(250) NOT NULL
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Alle 9 Alignments einfügen
|
||||||
|
insert into tblAlignments ([description])
|
||||||
|
values (N'Lawful Good'), (N'Neutral Good'), (N'Chaotic Good'), (N'Lawful Neutral'), (N'Neutral'), (N'Chaotic Neutral'), (N'Lawful Evil'), (N'Neutral Evil'), (N'Chaotic Evil')
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblAlignments')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblAlignments'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblAlignments') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblAlignments add nSeqDataXLink bigint null'
|
||||||
|
alter table tblAlignments add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
68
SQL/1_tables/tblArmors.sql
Normal file
68
SQL/1_tables/tblArmors.sql
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblArmors.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblArmors anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblArmors')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblArmors>'
|
||||||
|
|
||||||
|
-- drop table tblArmors
|
||||||
|
create table tblArmors (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblArmors] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Allgemeine Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [created] DateTime NOT NULL
|
||||||
|
, [lastModified] DateTime NOT NULL
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [name] nvarchar(250) NOT NULL
|
||||||
|
, [category] nvarchar(250) NOT NULL
|
||||||
|
, [cost] int NOT NULL
|
||||||
|
, [currency] nvarchar(250) NOT NULL
|
||||||
|
, [armorbonus] int NOT NULL
|
||||||
|
, [maxDexBonus] int NOT NULL
|
||||||
|
, [ArmorCheckPenalty] int NOT NULL
|
||||||
|
, [ArcaneSpellFailureChance] int NOT NULL
|
||||||
|
, [speed30] int NOT NULL
|
||||||
|
, [speed20] int NOT NULL
|
||||||
|
, [weight] int NOT NULL
|
||||||
|
, [hasMetal] bit NOT NULL
|
||||||
|
, [special] nvarchar(max) NOT NULL
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblArmors')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblArmors'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblArmors') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblArmors add nSeqDataXLink bigint null'
|
||||||
|
alter table tblArmors add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
|
@ -31,42 +31,55 @@ if not exists (select * from sys.tables where object_id = object_id (N'tblCharac
|
||||||
-- Parameter
|
-- Parameter
|
||||||
-- ----------------------------------------------------------------------
|
-- ----------------------------------------------------------------------
|
||||||
, [playerLink] int NOT NULL
|
, [playerLink] int NOT NULL
|
||||||
|
, [groupLink] int NOT NULL
|
||||||
|
, [classLink] int NOT NULL
|
||||||
|
, [raceLink] int NOT NULL
|
||||||
|
, [alignmentLink] int NOT NULL
|
||||||
|
, [deityLink] int NOT NULL
|
||||||
|
, [sizeLink] int NOT NULL
|
||||||
, [name] nvarchar(250) NOT NULL
|
, [name] nvarchar(250) NOT NULL
|
||||||
, [classLink] int NOT NULL
|
, [level] int NOT NULL
|
||||||
, [level] int NOT NULL
|
, [age] int NOT NULL
|
||||||
, [raceLink] int NOT NULL
|
, [gender] nvarchar(250) NOT NULL
|
||||||
, [alignmentLink] int NOT NULL
|
, [height] decimal NOT NULL
|
||||||
, [deityLink] int NOT NULL
|
, [weight] decimal NOT NULL
|
||||||
, [sizeLink] int NOT NULL
|
, [eyes] nvarchar(250) NOT NULL
|
||||||
, [age] int NOT NULL
|
, [hair] nvarchar(250) NOT NULL
|
||||||
, [gender] nvarchar(250) NOT NULL
|
, [skin] nvarchar(250) NOT NULL
|
||||||
, [height] decimal NOT NULL
|
, [strength] int NOT NULL
|
||||||
, [weight] decimal NOT NULL
|
, [dexterity] int NOT NULL
|
||||||
, [eyes] nvarchar(250) NOT NULL
|
, [constitution] int NOT NULL
|
||||||
, [hair] nvarchar(250) NOT NULL
|
, [intelligence] int NOT NULL
|
||||||
, [skin] nvarchar(250) NOT NULL
|
, [wisdom] int NOT NULL
|
||||||
, [strength] int NOT NULL
|
, [charisma] int NOT NULL
|
||||||
, [dexterity] int NOT NULL
|
, [strengthtemp] int NULL
|
||||||
, [constitution] int NOT NULL
|
, [dexteritytemp] int NULL
|
||||||
, [intelligence] int NOT NULL
|
, [constitutiontemp] int NULL
|
||||||
, [wisdom] int NOT NULL
|
, [intelligencetemp] int NULL
|
||||||
, [charisma] int NOT NULL
|
, [wisdomtemp] int NULL
|
||||||
, [strengthtemp] int NOT NULL
|
, [charismatemp] int NULL
|
||||||
, [dexteritytemp] int NOT NULL
|
, [fortitude] int NOT NULL
|
||||||
, [constitutiontemp] int NOT NULL
|
, [reflex] int NOT NULL
|
||||||
, [intelligencetemp] int NOT NULL
|
, [will] int NOT NULL
|
||||||
, [wisdomtemp] int NOT NULL
|
, [baseAttack] int NOT NULL
|
||||||
, [charismatemp] int NOT NULL
|
, [hp] int NOT NULL
|
||||||
, [Fort] int NOT NULL
|
, [tempHp] int NOT NULL
|
||||||
, [ref] int NOT NULL
|
, [nonLethalDmg] int NOT NULL
|
||||||
, [will] int NOT NULL
|
, [speed] int NOT NULL
|
||||||
, [baseAttack] int NOT NULL
|
, [dmgReduction] int NOT NULL
|
||||||
, [hp] int NOT NULL
|
, [spellResistance] int NOT NULL
|
||||||
, [tempHp] int NOT NULL
|
, [miscInitiative] int NULL
|
||||||
, [nonLethalDmg] int NOT NULL
|
, [miscArmor] int NULL
|
||||||
, [speed] int NOT NULL
|
, [miscFortitude] int NULL
|
||||||
, [dmgReduction] int NOT NULL
|
, [miscReflex] int NULL
|
||||||
, [miscIni] int NOT NULL
|
, [miscWill] int NULL
|
||||||
|
, [miscGrapple] int NULL
|
||||||
|
, [exp] int NOT NULL
|
||||||
|
, [copper] int NOT NULL
|
||||||
|
, [silver] int NOT NULL
|
||||||
|
, [gold] int NOT NULL
|
||||||
|
, [platin] int NOT NULL
|
||||||
|
,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not exists (select * from sys.tables where object_id = object_id ('tblCharacter')) begin
|
if not exists (select * from sys.tables where object_id = object_id ('tblCharacter')) begin
|
62
SQL/1_tables/tblDeities.sql
Normal file
62
SQL/1_tables/tblDeities.sql
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblDeities.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblDeities anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblDeities')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblDeities>'
|
||||||
|
|
||||||
|
-- drop table tblDeities
|
||||||
|
create table tblDeities (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblDeities] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Allgemeine Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [created] DateTime NOT NULL
|
||||||
|
, [lastModified] DateTime NOT NULL
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [name] nvarchar(250) NOT NULL
|
||||||
|
, [alignmentLink] int NOT NULL
|
||||||
|
, [portfolio] nvarchar(250) NOT NULL
|
||||||
|
, [description] nvarchar(max) NOT NULL
|
||||||
|
, [favoredWeaponLink] int NOT NULL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblDeities')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblDeities'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblDeities') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblDeities add nSeqDataXLink bigint null'
|
||||||
|
alter table tblDeities add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
57
SQL/1_tables/tblDeity2Domain.sql
Normal file
57
SQL/1_tables/tblDeity2Domain.sql
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblDeity2Domain.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblDeity2Domain anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblDeity2Domain')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblDeity2Domain>'
|
||||||
|
|
||||||
|
-- drop table tblDeity2Domain
|
||||||
|
create table tblDeity2Domain (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblDeity2Domain] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Allgemeine Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [created] DateTime NOT NULL
|
||||||
|
, [lastModified] DateTime NOT NULL
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [deityLink] int NOT NULL
|
||||||
|
, [domainLink] int NOT NULL
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblDeity2Domain')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblDeity2Domain'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblDeity2Domain') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblDeity2Domain add nSeqDataXLink bigint null'
|
||||||
|
alter table tblDeity2Domain add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
57
SQL/1_tables/tblDomains.sql
Normal file
57
SQL/1_tables/tblDomains.sql
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblDomains.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblDomains anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblDomains')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblDomains>'
|
||||||
|
|
||||||
|
-- drop table tblDomains
|
||||||
|
create table tblDomains (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblDomains] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Allgemeine Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [created] DateTime NOT NULL
|
||||||
|
, [lastModified] DateTime NOT NULL
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [name] nvarchar(250) NOT NULL
|
||||||
|
, [grantedPower] nvarchar(250) NOT NULL
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblDomains')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblDomains'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblDomains') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblDomains add nSeqDataXLink bigint null'
|
||||||
|
alter table tblDomains add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
67
SQL/1_tables/tblWeapons.sql
Normal file
67
SQL/1_tables/tblWeapons.sql
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/* ************************************************************************* *
|
||||||
|
*
|
||||||
|
* Datei: tblWeapons.sql
|
||||||
|
*
|
||||||
|
* Aufgabe: Tabelle tblWeapons anlegen
|
||||||
|
*
|
||||||
|
* Aenderungen:
|
||||||
|
* 2021-09-23, MWN, erstellt.
|
||||||
|
*
|
||||||
|
* ************************************************************************* */
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id (N'tblWeapons')) begin
|
||||||
|
|
||||||
|
-- Protokollausgabe
|
||||||
|
print 'Anlegen der Tabelle <' + db_name() + '.dbo.tblWeapons>'
|
||||||
|
|
||||||
|
-- drop table tblWeapons
|
||||||
|
create table tblWeapons (
|
||||||
|
|
||||||
|
-- Primaerschluessel
|
||||||
|
constraint [PK_tblWeapons] primary key ([key])
|
||||||
|
, [key] int identity(1, 1) not null
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Allgemeine Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [created] DateTime NOT NULL
|
||||||
|
, [lastModified] DateTime NOT NULL
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Parameter
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
, [name] nvarchar(250) NOT NULL
|
||||||
|
, [category] nvarchar(250) NOT NULL
|
||||||
|
, [cost] int NOT NULL
|
||||||
|
, [currency] nvarchar(250) NOT NULL
|
||||||
|
, [dmgSmall] nvarchar(250) NOT NULL
|
||||||
|
, [dmgMedium] nvarchar(250) NOT NULL
|
||||||
|
, [critrange] nvarchar(250) NOT NULL
|
||||||
|
, [crit] int NOT NULL
|
||||||
|
, [range] nvarchar(250) NOT NULL
|
||||||
|
, [weight] int NOT NULL
|
||||||
|
, [damagetype] nvarchar(250) NOT NULL
|
||||||
|
, [special] nvarchar(250) NOT NULL
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exists (select * from sys.tables where object_id = object_id ('tblWeapons')) begin
|
||||||
|
print ''
|
||||||
|
print '************************************'
|
||||||
|
print 'Fehler beim Erstellen der Tabelle tblWeapons'
|
||||||
|
print '************************************'
|
||||||
|
print ''
|
||||||
|
end
|
||||||
|
|
||||||
|
end /*else begin -- [if not exists (Tabelle)...]
|
||||||
|
|
||||||
|
-- Hinzufuegen einer Spalte
|
||||||
|
if not exists (select * from syscolumns where name = 'nSeqDataXLink' and id = object_id('tblWeapons') and objectproperty(id, N'IsUserTable') = 1) begin
|
||||||
|
print 'alter table tblWeapons add nSeqDataXLink bigint null'
|
||||||
|
alter table tblWeapons add nSeqDataXLink bigint null
|
||||||
|
end
|
||||||
|
|
||||||
|
end -- [if not exists (Tabelle)...]*/
|
||||||
|
go
|
||||||
|
|
||||||
|
-- :EOF:
|
0
SQL/insert/InsertAlignments.sql
Normal file
0
SQL/insert/InsertAlignments.sql
Normal file
Loading…
Reference in a new issue