AzubiProjekt/SQL/1_tables/tblWeapons.sql

68 lines
2.3 KiB
MySQL
Raw Normal View History

2021-09-24 14:16:37 +02:00
/* ************************************************************************* *
*
* 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: