Schreiben erster Tabellen.

This commit is contained in:
Mario Wuensch 2021-09-24 14:16:37 +02:00
parent 7415379d03
commit b1383770ff
9 changed files with 413 additions and 35 deletions

Binary file not shown.

View 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:

View 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:

View file

@ -31,13 +31,14 @@ if not exists (select * from sys.tables where object_id = object_id (N'tblCharac
-- Parameter -- Parameter
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
, [playerLink] int NOT NULL , [playerLink] int NOT NULL
, [name] nvarchar(250) NOT NULL , [groupLink] int NOT NULL
, [classLink] int NOT NULL , [classLink] int NOT NULL
, [level] int NOT NULL
, [raceLink] int NOT NULL , [raceLink] int NOT NULL
, [alignmentLink] int NOT NULL , [alignmentLink] int NOT NULL
, [deityLink] int NOT NULL , [deityLink] int NOT NULL
, [sizeLink] int NOT NULL , [sizeLink] int NOT NULL
, [name] nvarchar(250) NOT NULL
, [level] int NOT NULL
, [age] int NOT NULL , [age] int NOT NULL
, [gender] nvarchar(250) NOT NULL , [gender] nvarchar(250) NOT NULL
, [height] decimal NOT NULL , [height] decimal NOT NULL
@ -51,14 +52,14 @@ if not exists (select * from sys.tables where object_id = object_id (N'tblCharac
, [intelligence] int NOT NULL , [intelligence] int NOT NULL
, [wisdom] int NOT NULL , [wisdom] int NOT NULL
, [charisma] int NOT NULL , [charisma] int NOT NULL
, [strengthtemp] int NOT NULL , [strengthtemp] int NULL
, [dexteritytemp] int NOT NULL , [dexteritytemp] int NULL
, [constitutiontemp] int NOT NULL , [constitutiontemp] int NULL
, [intelligencetemp] int NOT NULL , [intelligencetemp] int NULL
, [wisdomtemp] int NOT NULL , [wisdomtemp] int NULL
, [charismatemp] int NOT NULL , [charismatemp] int NULL
, [Fort] int NOT NULL , [fortitude] int NOT NULL
, [ref] int NOT NULL , [reflex] int NOT NULL
, [will] int NOT NULL , [will] int NOT NULL
, [baseAttack] int NOT NULL , [baseAttack] int NOT NULL
, [hp] int NOT NULL , [hp] int NOT NULL
@ -66,7 +67,19 @@ if not exists (select * from sys.tables where object_id = object_id (N'tblCharac
, [nonLethalDmg] int NOT NULL , [nonLethalDmg] int NOT NULL
, [speed] int NOT NULL , [speed] int NOT NULL
, [dmgReduction] int NOT NULL , [dmgReduction] int NOT NULL
, [miscIni] int NOT NULL , [spellResistance] int NOT NULL
, [miscInitiative] int NULL
, [miscArmor] int NULL
, [miscFortitude] int NULL
, [miscReflex] int 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

View 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:

View 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:

View 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:

View 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:

View file