15069 lines
807 KiB
JSON
15069 lines
807 KiB
JSON
{
|
|
"version": 1,
|
|
"extractedAt": "2026-07-15T21:37:45.653Z",
|
|
"source": "eazybusiness",
|
|
"schemas": [
|
|
"Artikel",
|
|
"Pos",
|
|
"Rechnung",
|
|
"Verkauf",
|
|
"dbo"
|
|
],
|
|
"types": [
|
|
{
|
|
"schemaName": "Artikel",
|
|
"typeName": "TYPE_spAktualisiereArtikelspeicher",
|
|
"ddl": "CREATE TYPE [Artikel].[TYPE_spAktualisiereArtikelspeicher] AS TABLE (\n [kArtikel] int NOT NULL,\n PRIMARY KEY CLUSTERED ([kArtikel] ASC)\n)"
|
|
},
|
|
{
|
|
"schemaName": "Artikel",
|
|
"typeName": "TYPE_spAktualisiereStueckliste",
|
|
"ddl": "CREATE TYPE [Artikel].[TYPE_spAktualisiereStueckliste] AS TABLE (\n [kArtikel_Stueckliste] int NOT NULL,\n [nEnforceUpdateLagerbestand] bit NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spAktualisiereVarkombivater",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spAktualisiereVarkombivater] AS TABLE (\n [kArtikel] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spEingangsrechnungStatusSetzen",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spEingangsrechnungStatusSetzen] AS TABLE (\n [kEingangsrechnung] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spkundeInsert",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spkundeInsert] AS TABLE (\n [kInternalId] int IDENTITY(1,1) NOT NULL,\n [kInetKunde] int NULL,\n [kKundenKategorie] int NULL,\n [cKundenNr] nvarchar(30) NULL,\n [cFirma] nvarchar(128) NULL,\n [cAnrede] nvarchar(30) NULL,\n [cTitel] nvarchar(64) NULL,\n [cVorname] nvarchar(126) NULL,\n [cName] nvarchar(126) NULL,\n [cStrasse] nvarchar(255) NULL,\n [cPLZ] nvarchar(24) NULL,\n [cOrt] nvarchar(64) NULL,\n [cLand] nvarchar(64) NULL,\n [cTel] nvarchar(30) NULL,\n [cFax] nvarchar(30) NULL,\n [cEMail] nvarchar(255) NULL,\n [dErstellt] datetime NULL,\n [cMobil] nvarchar(30) NULL,\n [fRabatt] decimal(28,14) NULL,\n [cUSTID] nvarchar(20) NULL,\n [cNewsletter] char(1) NULL,\n [cZusatz] nvarchar(60) NULL,\n [cEbayName] nvarchar(60) NULL,\n [kBuyer] int NULL,\n [cAdressZusatz] nvarchar(255) NULL,\n [cGeburtstag] nvarchar(10) NULL,\n [cWWW] nvarchar(255) NULL,\n [cSperre] char(1) NULL,\n [cPostID] nvarchar(255) NULL,\n [kKundenGruppe] int NULL,\n [nZahlungsziel] int NULL,\n [kSprache] int NULL,\n [cISO] nvarchar(5) NULL,\n [cBundesland] nvarchar(255) NULL,\n [cHerkunft] nvarchar(255) NULL,\n [cKassenKunde] char(1) NULL,\n [cHRNr] nvarchar(255) NULL,\n [kZahlungsart] int NULL,\n [nDebitorennr] int NULL,\n [cSteuerNr] nvarchar(255) NULL,\n [nKreditlimit] int NULL,\n [kKundenDrucktext] int NULL,\n [nMahnstopp] tinyint NULL,\n [nMahnrhythmus] int NULL,\n [kFirma] tinyint NULL,\n [fProvision] decimal(25,13) NULL,\n [nVertreter] tinyint NULL,\n [fSkonto] decimal(25,13) NULL,\n [nSkontoInTagen] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spkundeUpdate",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spkundeUpdate] AS TABLE (\n [kKunde] int NOT NULL,\n [kInetKunde] int NULL,\n [xFlag_kInetKunde] bit NULL,\n [kKundenKategorie] int NULL,\n [xFlag_kKundenKategorie] bit NULL,\n [cKundenNr] nvarchar(30) NULL,\n [xFlag_cKundenNr] bit NULL,\n [dErstellt] datetime NULL,\n [xFlag_dErstellt] bit NULL,\n [fRabatt] decimal(25,13) NULL,\n [xFlag_fRabatt] bit NULL,\n [cNewsletter] char(1) NULL,\n [xFlag_cNewsletter] bit NULL,\n [cEbayName] nvarchar(60) NULL,\n [xFlag_cEbayName] bit NULL,\n [kBuyer] int NULL,\n [xFlag_kBuyer] bit NULL,\n [cGeburtstag] nvarchar(10) NULL,\n [xFlag_cGeburtstag] bit NULL,\n [cWWW] nvarchar(255) NULL,\n [xFlag_cWWW] bit NULL,\n [cSperre] char(1) NULL,\n [xFlag_cSperre] bit NULL,\n [kKundenGruppe] int NULL,\n [xFlag_kKundenGruppe] bit NULL,\n [nZahlungsziel] int NULL,\n [xFlag_nZahlungsziel] bit NULL,\n [kSprache] int NULL,\n [xFlag_kSprache] bit NULL,\n [cHerkunft] nvarchar(255) NULL,\n [xFlag_cHerkunft] bit NULL,\n [cKassenKunde] char(1) NULL,\n [xFlag_cKassenKunde] bit NULL,\n [cHRNr] nvarchar(255) NULL,\n [xFlag_cHRNr] bit NULL,\n [kZahlungsart] int NULL,\n [xFlag_kZahlungsart] bit NULL,\n [nDebitorennr] int NULL,\n [xFlag_nDebitorennr] bit NULL,\n [cSteuerNr] nvarchar(255) NULL,\n [xFlag_cSteuerNr] bit NULL,\n [nKreditlimit] int NULL,\n [xFlag_nKreditlimit] bit NULL,\n [kKundenDrucktext] int NULL,\n [xFlag_kKundenDrucktext] bit NULL,\n [nMahnstopp] tinyint NULL,\n [xFlag_nMahnstopp] bit NULL,\n [nMahnrhythmus] int NULL,\n [xFlag_nMahnrhythmus] bit NULL,\n [kFirma] tinyint NULL,\n [xFlag_kFirma] bit NULL,\n [fProvision] decimal(25,13) NULL,\n [xFlag_fProvision] bit NULL,\n [nVertreter] tinyint NULL,\n [xFlag_nVertreter] bit NULL,\n [fSkonto] decimal(25,13) NULL,\n [xFlag_fSkonto] bit NULL,\n [nSkontoInTagen] int NULL,\n [xFlag_nSkontoInTagen] bit NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spUpdateEbayBilderLaufendGeplant",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spUpdateEbayBilderLaufendGeplant] AS TABLE (\n [kArtikel] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spUpdateLagerbestand",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spUpdateLagerbestand] AS TABLE (\n [kArtikel] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"typeName": "TYPE_spUpdateLagerbestandProLager",
|
|
"ddl": "CREATE TYPE [dbo].[TYPE_spUpdateLagerbestandProLager] AS TABLE (\n [kArtikel] int NULL,\n [kWarenlager] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "Rechnung",
|
|
"typeName": "TYPE_spRechnungEckdatenBerechnen",
|
|
"ddl": "CREATE TYPE [Rechnung].[TYPE_spRechnungEckdatenBerechnen] AS TABLE (\n [kRechnung] int NULL\n)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"typeName": "TYPE_spAuftragEckdatenBerechnen",
|
|
"ddl": "CREATE TYPE [Verkauf].[TYPE_spAuftragEckdatenBerechnen] AS TABLE (\n [kAuftrag] int NOT NULL\n)"
|
|
}
|
|
],
|
|
"tables": [
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tArtikel",
|
|
"ddl": "CREATE TABLE [dbo].[tArtikel] (\n [kArtikel] int IDENTITY(1,1) NOT NULL,\n [cArtNr] nvarchar(100) NOT NULL,\n [fVKNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fUVP] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cAnmerkung] nvarchar(MAX) NULL,\n [cPreisliste] char(1) DEFAULT ('N') NOT NULL,\n [cAktiv] char(1) DEFAULT ('N') NOT NULL,\n [nLagerbestand] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nMindestbestellmaenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cBarcode] nvarchar(255) NULL,\n [cTopArtikel] char(1) DEFAULT ('N') NULL,\n [cInet] char(1) DEFAULT ('N') NOT NULL,\n [cDelInet] char(1) NULL,\n [fGewicht] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cNeu] char(1) DEFAULT ('N') NOT NULL,\n [cLagerArtikel] char(1) DEFAULT ('N') NULL,\n [cTeilbar] char(1) DEFAULT ('N') NULL,\n [cLagerAktiv] char(1) DEFAULT ('N') NOT NULL,\n [cLagerKleinerNull] char(1) DEFAULT ('N') NOT NULL,\n [nMidestbestand] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fEKNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fEbayPreis] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cLagerVariation] char(1) DEFAULT ('N') NOT NULL,\n [nDelete] tinyint DEFAULT ((0)) NULL,\n [dMod] datetime2(2) NULL,\n [fPackeinheit] decimal(25,13) DEFAULT ((0)) NOT NULL,\n [nVPE] tinyint NULL,\n [fVPEWert] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cSuchbegriffe] nvarchar(255) NULL,\n [cTaric] nvarchar(20) NULL,\n [cHerkunftsland] nvarchar(64) NULL,\n [kSteuerklasse] int DEFAULT ((0)) NOT NULL,\n [dErstelldatum] datetime2(2) NULL,\n [dErscheinungsdatum] datetime2(2) NULL,\n [nSort] int NULL,\n [kVersandklasse] int NULL,\n [fArtGewicht] decimal(25,13) DEFAULT ((0)) NOT NULL,\n [cHAN] nvarchar(255) NULL,\n [cSerie] nvarchar(255) NULL,\n [cISBN] nvarchar(255) DEFAULT ('') NULL,\n [cUNNummer] nvarchar(255) DEFAULT ('') NULL,\n [cGefahrnr] nvarchar(255) DEFAULT ('') NULL,\n [cASIN] nvarchar(255) DEFAULT ('') NULL,\n [kEigenschaftKombi] int DEFAULT ((0)) NOT NULL,\n [kVaterArtikel] int DEFAULT ((0)) NOT NULL,\n [nIstVater] tinyint DEFAULT ((0)) NOT NULL,\n [nIstMindestbestand] tinyint NULL,\n [fAbnahmeintervall] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kStueckliste] int DEFAULT ((0)) NOT NULL,\n [cUPC] nvarchar(255) NULL,\n [kWarengruppe] int DEFAULT ((0)) NOT NULL,\n [cEPID] nvarchar(255) NULL,\n [nMHD] tinyint DEFAULT ((0)) NOT NULL,\n [nCharge] tinyint DEFAULT ((0)) NOT NULL,\n [nNichtBestellbar] tinyint DEFAULT ((0)) NOT NULL,\n [fAmazonVK] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nPufferTyp] tinyint NULL,\n [nPuffer] int NOT NULL,\n [nProzentualePreisStaffelAktiv] tinyint DEFAULT ((0)) NOT NULL,\n [nSeriennummernVerfolgung] tinyint DEFAULT ((0)) NOT NULL,\n [kHersteller] int NULL,\n [kLieferStatus] int NULL,\n [kMassEinheit] int NULL,\n [fMassMenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kGrundPreisEinheit] int NULL,\n [fGrundpreisMenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fBreite] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fHoehe] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fLaenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kVPEEinheit] int NULL,\n [nLiefertageWennAusverkauft] int DEFAULT ((0)) NULL,\n [kVerkaufsEinheit] int NULL,\n [dZulaufVerfuegbarAm] datetime2(2) NULL,\n [nAutomatischeLiefertageberechnung] tinyint DEFAULT ((1)) NULL,\n [nBearbeitungszeit] int NULL,\n [fLetzterEK] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [dLetzterEK] datetime2(2) NULL,\n [kBenutzerLetzteAenderung] int NULL,\n [nZulaufVerfuegbarMenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [dNeuImSortiment] datetime2(2) NULL,\n [nEbayAbgleich] tinyint DEFAULT ((0)) NOT NULL,\n [kZustand] int DEFAULT ((1)) NOT NULL,\n [cAmazonFNSKU] nvarchar(50) NULL,\n [cJfsku] nvarchar(50) NULL,\n [nSonderTyp] tinyint DEFAULT ((0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nNichtRabattfaehig] tinyint DEFAULT ((0)) NOT NULL,\n [cLabelNamen] nvarchar(MAX) NULL,\n [kDefinition] int NULL,\n [nIstTeilmengenArtikel] tinyint DEFAULT ((0)) NOT NULL,\n [nSeriennummernstatus] tinyint DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kArtikel",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2370"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2370",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cArtNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "fVKNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "fUVP",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cAnmerkung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cPreisliste",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cAktiv",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nLagerbestand",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "nMindestbestellmaenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cBarcode",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cTopArtikel",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "cDelInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "fGewicht",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "cNeu",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cLagerArtikel",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cTeilbar",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cLagerAktiv",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "cLagerKleinerNull",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nMidestbestand",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "fEKNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "fEbayPreis",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "cLagerVariation",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "nDelete",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "dMod",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "fPackeinheit",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "nVPE",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "fVPEWert",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "cSuchbegriffe",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
},
|
|
{
|
|
"columnName": "cTaric",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 30
|
|
},
|
|
{
|
|
"columnName": "cHerkunftsland",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 128,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 31
|
|
},
|
|
{
|
|
"columnName": "kSteuerklasse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 32
|
|
},
|
|
{
|
|
"columnName": "dErstelldatum",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 33
|
|
},
|
|
{
|
|
"columnName": "dErscheinungsdatum",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 34
|
|
},
|
|
{
|
|
"columnName": "nSort",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 35
|
|
},
|
|
{
|
|
"columnName": "kVersandklasse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 36
|
|
},
|
|
{
|
|
"columnName": "fArtGewicht",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 37
|
|
},
|
|
{
|
|
"columnName": "cHAN",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 38
|
|
},
|
|
{
|
|
"columnName": "cSerie",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 39
|
|
},
|
|
{
|
|
"columnName": "cISBN",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 40
|
|
},
|
|
{
|
|
"columnName": "cUNNummer",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 41
|
|
},
|
|
{
|
|
"columnName": "cGefahrnr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 42
|
|
},
|
|
{
|
|
"columnName": "cASIN",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 43
|
|
},
|
|
{
|
|
"columnName": "kEigenschaftKombi",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 44
|
|
},
|
|
{
|
|
"columnName": "kVaterArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 45
|
|
},
|
|
{
|
|
"columnName": "nIstVater",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 46
|
|
},
|
|
{
|
|
"columnName": "nIstMindestbestand",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 47
|
|
},
|
|
{
|
|
"columnName": "fAbnahmeintervall",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 48
|
|
},
|
|
{
|
|
"columnName": "kStueckliste",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 49
|
|
},
|
|
{
|
|
"columnName": "cUPC",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 50
|
|
},
|
|
{
|
|
"columnName": "kWarengruppe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 51
|
|
},
|
|
{
|
|
"columnName": "cEPID",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 52
|
|
},
|
|
{
|
|
"columnName": "nMHD",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 53
|
|
},
|
|
{
|
|
"columnName": "nCharge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 54
|
|
},
|
|
{
|
|
"columnName": "nNichtBestellbar",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 55
|
|
},
|
|
{
|
|
"columnName": "fAmazonVK",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 56
|
|
},
|
|
{
|
|
"columnName": "nPufferTyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 57
|
|
},
|
|
{
|
|
"columnName": "nPuffer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 58
|
|
},
|
|
{
|
|
"columnName": "nProzentualePreisStaffelAktiv",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 59
|
|
},
|
|
{
|
|
"columnName": "nSeriennummernVerfolgung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 60
|
|
},
|
|
{
|
|
"columnName": "kHersteller",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 61
|
|
},
|
|
{
|
|
"columnName": "kLieferStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 62
|
|
},
|
|
{
|
|
"columnName": "kMassEinheit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 63
|
|
},
|
|
{
|
|
"columnName": "fMassMenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 64
|
|
},
|
|
{
|
|
"columnName": "kGrundPreisEinheit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 65
|
|
},
|
|
{
|
|
"columnName": "fGrundpreisMenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 66
|
|
},
|
|
{
|
|
"columnName": "fBreite",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 67
|
|
},
|
|
{
|
|
"columnName": "fHoehe",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 68
|
|
},
|
|
{
|
|
"columnName": "fLaenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 69
|
|
},
|
|
{
|
|
"columnName": "kVPEEinheit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 70
|
|
},
|
|
{
|
|
"columnName": "nLiefertageWennAusverkauft",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 71
|
|
},
|
|
{
|
|
"columnName": "kVerkaufsEinheit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 72
|
|
},
|
|
{
|
|
"columnName": "dZulaufVerfuegbarAm",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 73
|
|
},
|
|
{
|
|
"columnName": "nAutomatischeLiefertageberechnung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 74
|
|
},
|
|
{
|
|
"columnName": "nBearbeitungszeit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 75
|
|
},
|
|
{
|
|
"columnName": "fLetzterEK",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 76
|
|
},
|
|
{
|
|
"columnName": "dLetzterEK",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 77
|
|
},
|
|
{
|
|
"columnName": "kBenutzerLetzteAenderung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 78
|
|
},
|
|
{
|
|
"columnName": "nZulaufVerfuegbarMenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 79
|
|
},
|
|
{
|
|
"columnName": "dNeuImSortiment",
|
|
"typeName": "datetime2",
|
|
"maxLength": 6,
|
|
"precision": 22,
|
|
"scale": 2,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 80
|
|
},
|
|
{
|
|
"columnName": "nEbayAbgleich",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 81
|
|
},
|
|
{
|
|
"columnName": "kZustand",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 82
|
|
},
|
|
{
|
|
"columnName": "cAmazonFNSKU",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 83
|
|
},
|
|
{
|
|
"columnName": "cJfsku",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 84
|
|
},
|
|
{
|
|
"columnName": "nSonderTyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 85
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 86
|
|
},
|
|
{
|
|
"columnName": "nNichtRabattfaehig",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 87
|
|
},
|
|
{
|
|
"columnName": "cLabelNamen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 88
|
|
},
|
|
{
|
|
"columnName": "kDefinition",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 89
|
|
},
|
|
{
|
|
"columnName": "nIstTeilmengenArtikel",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 90
|
|
},
|
|
{
|
|
"columnName": "nSeriennummernstatus",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 91
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tArtikelAttribut",
|
|
"ddl": "CREATE TABLE [dbo].[tArtikelAttribut] (\n [kArtikelAttribut] int IDENTITY(1,1) NOT NULL,\n [kArtikel] int NOT NULL,\n [kAttribut] int NOT NULL,\n [kShop] int NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kArtikelAttribut",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "1173"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kArtikelAttribut",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "1173",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kAttribut",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tArtikelAttributSprache",
|
|
"ddl": "CREATE TABLE [dbo].[tArtikelAttributSprache] (\n [kArtikelAttribut] int NOT NULL,\n [kSprache] int NOT NULL,\n [cWertVarchar] nvarchar(MAX) NULL,\n [nWertInt] int NULL,\n [fWertDecimal] decimal(25,13) NULL,\n [dWertDateTime] datetime NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kArtikelAttribut",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cWertVarchar",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nWertInt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "fWertDecimal",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "dWertDateTime",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tArtikelBeschreibung",
|
|
"ddl": "CREATE TABLE [dbo].[tArtikelBeschreibung] (\n [kArtikel] int NOT NULL,\n [kSprache] int NOT NULL,\n [kPlattform] int NOT NULL,\n [kShop] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [cBeschreibung] nvarchar(MAX) NULL,\n [cKurzBeschreibung] nvarchar(MAX) NULL,\n [cUrlPfad] nvarchar(255) NULL,\n [cMetaDescription] nvarchar(MAX) NULL,\n [cTitleTag] nvarchar(4000) NULL,\n [cMetaKeywords] nvarchar(4000) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cBeschreibung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cKurzBeschreibung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cUrlPfad",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cMetaDescription",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cTitleTag",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 8000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cMetaKeywords",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 8000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tArtikelbildPlattform",
|
|
"ddl": "CREATE TABLE [dbo].[tArtikelbildPlattform] (\n [kArtikelbildPlattform] int IDENTITY(1,1) NOT NULL,\n [kBild] int NOT NULL,\n [kArtikel] int NOT NULL,\n [kPlattform] int NOT NULL,\n [kShop] int NOT NULL,\n [nNr] int NOT NULL,\n [nInet] tinyint DEFAULT ((1)) NOT NULL,\n [kEbayUser] int DEFAULT ((0)) NOT NULL,\n [cBildname] nvarchar(255) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kArtikelbildPlattform",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3109"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kArtikelbildPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3109",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kBild",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nNr",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nInet",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "kEbayUser",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cBildname",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tAttribut",
|
|
"ddl": "CREATE TABLE [dbo].[tAttribut] (\n [kAttribut] int IDENTITY(1,1) NOT NULL,\n [nIstMehrsprachig] tinyint NOT NULL,\n [nIstFreifeld] tinyint NOT NULL,\n [nSortierung] int NOT NULL,\n [cBeschreibung] nvarchar(1000) NULL,\n [nBezugstyp] tinyint NOT NULL,\n [nAusgabeweg] tinyint NOT NULL,\n [nIstStandard] tinyint DEFAULT ((0)) NOT NULL,\n [kFeldTyp] int NOT NULL,\n [cRegEx] nvarchar(MAX) NULL,\n [cGruppeName] nvarchar(150) NULL,\n [nReadOnly] tinyint DEFAULT ((0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nAktivFuerArtikelOhneWarengruppe] bit DEFAULT ((1)) NOT NULL,\n [nIstPflichtfeld] bit DEFAULT ((0)) NULL,\n [cAttributId] nvarchar(255) DEFAULT (newid()) NOT NULL,\n [nIstUnsichtbar] bit DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kAttribut",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "170"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kAttribut",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "170",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "nIstMehrsprachig",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "nIstFreifeld",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nSortierung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cBeschreibung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nBezugstyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nAusgabeweg",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nIstStandard",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kFeldTyp",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cRegEx",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cGruppeName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 300,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "nReadOnly",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nAktivFuerArtikelOhneWarengruppe",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nIstPflichtfeld",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cAttributId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "(newid())",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "nIstUnsichtbar",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tAttributSprache",
|
|
"ddl": "CREATE TABLE [dbo].[tAttributSprache] (\n [kAttribut] int NOT NULL,\n [kSprache] int NOT NULL,\n [cName] nvarchar(255) NOT NULL,\n [cWertListe] nvarchar(MAX) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kAttribut",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cWertListe",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tBild",
|
|
"ddl": "CREATE TABLE [dbo].[tBild] (\n [kBild] int IDENTITY(1,1) NOT NULL,\n [cQuelle] varchar(500) NOT NULL,\n [bBild] image NOT NULL,\n [nDateigroesse] int NOT NULL,\n [nBreite] int NOT NULL,\n [nHoehe] int NOT NULL,\n [cHash] nvarchar(255) NOT NULL,\n [cChecksum] nvarchar(255) NOT NULL,\n [bVorschauBild] image NOT NULL,\n [nVorschauDateigroesse] int NOT NULL,\n [nVorschauBreite] int NOT NULL,\n [nVorschauHoehe] int NOT NULL,\n [dErstellt] datetime NOT NULL,\n [dAenderung] datetime NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kBild",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2418"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kBild",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2418",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cQuelle",
|
|
"typeName": "varchar",
|
|
"maxLength": 500,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "bBild",
|
|
"typeName": "image",
|
|
"maxLength": 16,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nDateigroesse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nBreite",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nHoehe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cHash",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cChecksum",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "bVorschauBild",
|
|
"typeName": "image",
|
|
"maxLength": 16,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "nVorschauDateigroesse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "nVorschauBreite",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "nVorschauHoehe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "dErstellt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "dAenderung",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tFirmaHistory",
|
|
"ddl": "CREATE TABLE [dbo].[tFirmaHistory] (\n [kFirmaHistory] int IDENTITY(1,1) NOT NULL,\n [kFirma] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [cUnternehmer] nvarchar(255) NULL,\n [cStrasse] nvarchar(255) NULL,\n [cPLZ] nvarchar(50) NULL,\n [cOrt] nvarchar(255) NULL,\n [cLand] nvarchar(255) NULL,\n [cTel] nvarchar(50) NULL,\n [cFax] nvarchar(30) NULL,\n [cEMail] nvarchar(255) NULL,\n [cWWW] nvarchar(255) NULL,\n [cBank] nvarchar(50) NULL,\n [cSteuerNr] nvarchar(25) NULL,\n [cIBAN] nvarchar(64) NULL,\n [cBIC] nvarchar(64) NULL,\n [cKontoInhaber] nvarchar(255) NULL,\n [cGlaeubigerID] nvarchar(35) NULL,\n [cLandISO] nvarchar(5) NULL,\n [cPayPalEMail] nvarchar(250) NULL,\n [nKleinunternehmer] bit NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kFirmaHistory",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kFirmaHistory",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cUnternehmer",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cStrasse",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cPLZ",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cOrt",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cLand",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cTel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cFax",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cEMail",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cWWW",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "cBank",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "cSteuerNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 50,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "cIBAN",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 128,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cBIC",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 128,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cKontoInhaber",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cGlaeubigerID",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 70,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "cLandISO",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 10,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "cPayPalEMail",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 500,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nKleinunternehmer",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKategorie",
|
|
"ddl": "CREATE TABLE [dbo].[tKategorie] (\n [kKategorie] int NOT NULL,\n [kOberKategorie] int NULL,\n [cInet] char(1) NULL,\n [cAktiv] char(1) NULL,\n [cDelInet] char(1) NULL,\n [nSort] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kOberKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cAktiv",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cDelInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nSort",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKategorieArtikel",
|
|
"ddl": "CREATE TABLE [dbo].[tKategorieArtikel] (\n [kKategorieArtikel] int IDENTITY(1,1) NOT NULL,\n [kArtikel] int NOT NULL,\n [kKategorie] int NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kKategorieArtikel",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3403"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kKategorieArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3403",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKategorieShop",
|
|
"ddl": "CREATE TABLE [dbo].[tKategorieShop] (\n [kKategorie] int NOT NULL,\n [kShop] int NOT NULL,\n [cInet] char(1) NULL,\n [cDelInet] char(1) NULL,\n [nInBearbeitung] bit NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cDelInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nInBearbeitung",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKategorieSprache",
|
|
"ddl": "CREATE TABLE [dbo].[tKategorieSprache] (\n [kKategorie] int NOT NULL,\n [kSprache] int NOT NULL,\n [kPlattform] int DEFAULT ((0)) NOT NULL,\n [kShop] int DEFAULT ((0)) NOT NULL,\n [cName] nvarchar(255) NULL,\n [cBeschreibung] nvarchar(MAX) NULL,\n [cUrlPfad] nvarchar(255) NULL,\n [cMetaDescription] nvarchar(MAX) NULL,\n [cTitleTag] nvarchar(4000) NULL,\n [cMetaKeywords] nvarchar(4000) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cBeschreibung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cUrlPfad",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cMetaDescription",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cTitleTag",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 8000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cMetaKeywords",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 8000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKategoriebildPlattform",
|
|
"ddl": "CREATE TABLE [dbo].[tKategoriebildPlattform] (\n [kKategoriebildPlattform] int IDENTITY(1,1) NOT NULL,\n [kBild] int NOT NULL,\n [kKategorie] int NOT NULL,\n [kPlattform] int NOT NULL,\n [kShop] int NOT NULL,\n [nNr] int NOT NULL,\n [nInet] tinyint DEFAULT ((1)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kKategoriebildPlattform",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "1032"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kKategoriebildPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "1032",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kBild",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nNr",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nInet",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKunde",
|
|
"ddl": "CREATE TABLE [dbo].[tKunde] (\n [kKunde] int IDENTITY(1,1) NOT NULL,\n [kInetKunde] int NULL,\n [kKundenKategorie] int NULL,\n [cKundenNr] nvarchar(30) NULL,\n [dErstellt] datetime NULL,\n [fRabatt] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cNewsletter] char(1) NULL,\n [cEbayName] nvarchar(255) DEFAULT ('') NULL,\n [kBuyer] int DEFAULT ((0)) NULL,\n [cGeburtstag] nvarchar(10) NULL,\n [cWWW] nvarchar(255) NULL,\n [cSperre] char(1) DEFAULT ('N') NULL,\n [kKundenGruppe] int NULL,\n [nZahlungsziel] int NULL,\n [kSprache] int NULL,\n [cHerkunft] nvarchar(255) NULL,\n [cKassenKunde] char(1) NULL,\n [cHRNr] nvarchar(255) NULL,\n [kZahlungsart] int NULL,\n [nDebitorennr] int NULL,\n [cSteuerNr] nvarchar(255) NULL,\n [nKreditlimit] int NULL,\n [kKundenDrucktext] int NULL,\n [nMahnstopp] tinyint DEFAULT ((0)) NOT NULL,\n [nMahnrhythmus] int DEFAULT ((0)) NOT NULL,\n [kFirma] tinyint DEFAULT ((0)) NOT NULL,\n [fProvision] decimal(25,13) NULL,\n [nVertreter] tinyint DEFAULT ((0)) NOT NULL,\n [fSkonto] decimal(25,13) DEFAULT ((0)) NOT NULL,\n [nSkontoInTagen] int DEFAULT ((0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kKunde",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "1001"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kKunde",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "1001",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kInetKunde",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kKundenKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cKundenNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "dErstellt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "fRabatt",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cNewsletter",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cEbayName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kBuyer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cGeburtstag",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 20,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cWWW",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cSperre",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "('N')",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "kKundenGruppe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nZahlungsziel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cHerkunft",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cKassenKunde",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cHRNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "kZahlungsart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nDebitorennr",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "cSteuerNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "nKreditlimit",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "kKundenDrucktext",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "nMahnstopp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "nMahnrhythmus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "fProvision",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "nVertreter",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "fSkonto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
},
|
|
{
|
|
"columnName": "nSkontoInTagen",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 30
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 31
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tKundenGruppe",
|
|
"ddl": "CREATE TABLE [dbo].[tKundenGruppe] (\n [kKundenGruppe] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [nStandard] tinyint NULL,\n [nShopLogin] tinyint NULL,\n [nNettoPreise] tinyint NULL,\n [fRabatt] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kKundenDrucktext] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nRabattVeraendert] bit DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kKundenGruppe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "nStandard",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nShopLogin",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nNettoPreise",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "fRabatt",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "kKundenDrucktext",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "nRabattVeraendert",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tLaufendeNummern",
|
|
"ddl": "CREATE TABLE [dbo].[tLaufendeNummern] (\n [kLaufendeNummer] int IDENTITY(1,1) NOT NULL,\n [cName] nvarchar(100) NULL,\n [nNummer] int NULL,\n [cPrefix] nvarchar(20) NULL,\n [cSuffix] nvarchar(20) NULL,\n [kFirma] int NULL,\n [cTable] nvarchar(100) NULL,\n [cColumn] nvarchar(100) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cTypeColumn] nvarchar(20) NULL,\n [cTypeValue] nvarchar(4) NULL,\n [cAnzeigename] nvarchar(100) NULL\n)",
|
|
"identity": {
|
|
"column": "kLaufendeNummer",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "28"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kLaufendeNummer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "28",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "nNummer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cPrefix",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cSuffix",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cTable",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cColumn",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cTypeColumn",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cTypeValue",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cAnzeigename",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tLieferschein",
|
|
"ddl": "CREATE TABLE [dbo].[tLieferschein] (\n [kLieferschein] int IDENTITY(1,1) NOT NULL,\n [kBestellung] int NOT NULL,\n [kBenutzer] int NOT NULL,\n [cLieferscheinNr] nvarchar(50) NULL,\n [cHinweis] nvarchar(255) NULL,\n [dMailVersand] datetime NULL,\n [dErstellt] datetime NULL,\n [dGedruckt] datetime NULL,\n [nFulfillment] int NULL,\n [kLieferantenBestellung] int NULL,\n [kSessionId] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kLieferschein",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2229"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kLieferschein",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2229",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kBestellung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kBenutzer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cLieferscheinNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cHinweis",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "dMailVersand",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "dErstellt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "dGedruckt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "nFulfillment",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kLieferantenBestellung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "kSessionId",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tPickliste",
|
|
"ddl": "CREATE TABLE [dbo].[tPickliste] (\n [kPickliste] int IDENTITY(1,1) NOT NULL,\n [kWarenLager] int NULL,\n [kPicklistenVorlage] int NULL,\n [nStatus] int NULL,\n [kPicklisteStatus] int NULL,\n [kPicklisteStatusAngelegt] int NULL,\n [dGedruckt] datetime NULL,\n [kSessionId] int NULL,\n [kLieferant] int NULL,\n [kAnsprechpartner] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cPicklisteNr] nvarchar(255) NULL,\n [nType] int DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kPickliste",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2229"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kPickliste",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2229",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kWarenLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kPicklistenVorlage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "kPicklisteStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "kPicklisteStatusAngelegt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "dGedruckt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "kSessionId",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kLieferant",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kAnsprechpartner",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cPicklisteNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nType",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tPicklistePos",
|
|
"ddl": "CREATE TABLE [dbo].[tPicklistePos] (\n [kPicklistePos] int IDENTITY(1,1) NOT NULL,\n [kPickliste] int NOT NULL,\n [kWarenLager] int NULL,\n [kWarenLagerEingang] int NULL,\n [fAnzahl] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kBestellPos] int NULL,\n [kPicklistePosStatus] int NULL,\n [kArtikel] int NULL,\n [kWarenlagerPlatz] int NULL,\n [kPicklistePos_Ursprung] int NULL,\n [kLieferscheinPos] int DEFAULT ((0)) NOT NULL,\n [kBestellung] int DEFAULT ((0)) NOT NULL,\n [nPickPrio] int DEFAULT ((0)) NOT NULL,\n [nStatus] int NULL,\n [kAnsprechpartner] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nVorreserviert] tinyint DEFAULT ((0)) NULL\n)",
|
|
"identity": {
|
|
"column": "kPicklistePos",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3409"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kPicklistePos",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3409",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kPickliste",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kWarenLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kWarenLagerEingang",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "fAnzahl",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "kBestellPos",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "kPicklistePosStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kWarenlagerPlatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kPicklistePos_Ursprung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "kLieferscheinPos",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "kBestellung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nPickPrio",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "kAnsprechpartner",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "nVorreserviert",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tPlattform",
|
|
"ddl": "CREATE TABLE [dbo].[tPlattform] (\n [nPlattform] int IDENTITY(20000,1) NOT NULL,\n [cName] nvarchar(30) NOT NULL,\n [cID] nvarchar(30) NOT NULL,\n [nInet] int NOT NULL,\n [cWaehrung] nvarchar(20) NULL,\n [nTyp] int DEFAULT ((9)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "nPlattform",
|
|
"seed": "20000",
|
|
"increment": "1",
|
|
"lastValue": null
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "nPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "20000",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cID",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nInet",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cWaehrung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nTyp",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((9))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tPreis",
|
|
"ddl": "CREATE TABLE [dbo].[tPreis] (\n [kPreis] int IDENTITY(1,1) NOT NULL,\n [kArtikel] int NOT NULL,\n [kKundenGruppe] int NOT NULL,\n [kShop] int NOT NULL,\n [kKunde] int NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kPreis",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "1001"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kPreis",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "1001",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kKundenGruppe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "kKunde",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tPreisDetail",
|
|
"ddl": "CREATE TABLE [dbo].[tPreisDetail] (\n [kPreis] int NOT NULL,\n [nAnzahlAb] int NOT NULL,\n [fNettoPreis] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fProzent] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kPreis",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "nAnzahlAb",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "fNettoPreis",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "fProzent",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tSessionId",
|
|
"ddl": "CREATE TABLE [dbo].[tSessionId] (\n [kSessionId] int IDENTITY(1,1) NOT NULL,\n [cRechnername] nvarchar(255) NOT NULL,\n [kBenutzer] int NOT NULL,\n [dLastAction] datetime NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kSessionId",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3255"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kSessionId",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3255",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cRechnername",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kBenutzer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "dLastAction",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tShop",
|
|
"ddl": "CREATE TABLE [dbo].[tShop] (\n [kShop] int NOT NULL,\n [cAPIKey] nvarchar(64) NULL,\n [cName] nvarchar(255) NULL,\n [cServerWeb] nvarchar(255) NULL,\n [cBenutzerWeb] nvarchar(32) NULL,\n [cPasswortWeb] nvarchar(255) NULL,\n [nHttpPut] tinyint NULL,\n [nShopAuftragsNr] tinyint NULL,\n [nGesperrt] tinyint NULL,\n [kFirma] int NULL,\n [nAngebot] tinyint NULL,\n [kKategorie] int NULL,\n [nTyp] tinyint DEFAULT ((0)) NOT NULL,\n [kAlterShop] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [kWarenlager] int NULL,\n [kWarenlagerRetoure] int NULL,\n [kWarenlagerRetourePlatz] int NULL,\n [kWarenlagerPlatz] int NULL,\n [nWarenlagerPlatztyp] tinyint NULL,\n [nWarenlagerRetourePlatztyp] tinyint NULL,\n [cBelegDrucker] nvarchar(128) DEFAULT (NULL) NULL,\n [nAktiv] bit DEFAULT ((1)) NOT NULL,\n [cGutscheinDrucker] nvarchar(128) NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cAPIKey",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 128,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cServerWeb",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cBenutzerWeb",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 64,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cPasswortWeb",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nHttpPut",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nShopAuftragsNr",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "nGesperrt",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "nAngebot",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "kKategorie",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nTyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "kAlterShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "kWarenlager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "kWarenlagerRetoure",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "kWarenlagerRetourePlatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "kWarenlagerPlatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nWarenlagerPlatztyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nWarenlagerRetourePlatztyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "cBelegDrucker",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 256,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "(NULL)",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "nAktiv",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "cGutscheinDrucker",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 256,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tShopSubshop",
|
|
"ddl": "CREATE TABLE [dbo].[tShopSubshop] (\n [kShopSubshop] int IDENTITY(1,1) NOT NULL,\n [kShop] int NOT NULL,\n [cIdentifier] nvarchar(50) NULL,\n [nGesperrt] tinyint NOT NULL,\n [cAuthToken] nvarchar(255) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nMaxLastChanged] bigint DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kShopSubshop",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kShopSubshop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cIdentifier",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nGesperrt",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cAuthToken",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nMaxLastChanged",
|
|
"typeName": "bigint",
|
|
"maxLength": 8,
|
|
"precision": 19,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tSteuersatz",
|
|
"ddl": "CREATE TABLE [dbo].[tSteuersatz] (\n [kSteuersatz] int IDENTITY(1,1) NOT NULL,\n [kSteuerzone] int NULL,\n [kSteuerklasse] int NULL,\n [fSteuersatz] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nPrio] tinyint NULL,\n [kStSchl] int NULL,\n [kStSchlIGL] int NULL,\n [kStSchlUStIGL] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [kStSchlReverse] int NULL\n)",
|
|
"identity": {
|
|
"column": "kSteuersatz",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "4"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kSteuersatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "4",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSteuerzone",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kSteuerklasse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "fSteuersatz",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nPrio",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "kStSchl",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "kStSchlIGL",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "kStSchlUStIGL",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kStSchlReverse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tSteuerzone",
|
|
"ddl": "CREATE TABLE [dbo].[tSteuerzone] (\n [kSteuerzone] int IDENTITY(1,1) NOT NULL,\n [kFirma] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [cLandISO] nvarchar(5) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nUstIdB2B] tinyint DEFAULT ((0)) NOT NULL,\n [nUstIdB2C] tinyint DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kSteuerzone",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kSteuerzone",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cLandISO",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 10,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nUstIdB2B",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nUstIdB2C",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tStueckliste",
|
|
"ddl": "CREATE TABLE [dbo].[tStueckliste] (\n [kStueckliste] int NOT NULL,\n [kArtikel] int NOT NULL,\n [fAnzahl] decimal(25,13) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cKommentar] nvarchar(255) NULL,\n [nSort] int DEFAULT ((0)) NOT NULL,\n [kVaterArtikel] int DEFAULT ((-1)) NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kStueckliste",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "fAnzahl",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cKommentar",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "nSort",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "kVaterArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((-1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tVersand",
|
|
"ddl": "CREATE TABLE [dbo].[tVersand] (\n [kVersand] int IDENTITY(1,1) NOT NULL,\n [kLieferschein] int NOT NULL,\n [kBenutzer] int NOT NULL,\n [kLogistik] int NULL,\n [cIdentCode] nvarchar(255) NULL,\n [dErstellt] datetime NULL,\n [cHinweis] nvarchar(255) NULL,\n [fGewicht] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [kVersandArt] int NULL,\n [cLogistiker] nvarchar(50) NULL,\n [cFulfillmentCenter] nvarchar(50) NULL,\n [dAnkunftszeit] datetime NULL,\n [nVerpackZeitSek] int NULL,\n [dVersendet] datetime NULL,\n [nStatus] tinyint DEFAULT ((0)) NOT NULL,\n [cShipmentId] nvarchar(50) NULL,\n [cReference] nvarchar(255) NULL,\n [cShipmentOrderId] nvarchar(100) NULL,\n [kKartonAuftragPos] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cEnclosedReturnIdentCode] nvarchar(255) NULL,\n [nViaAmazonMWS] int DEFAULT ((0)) NOT NULL,\n [kReturnVersandart] int NULL\n)",
|
|
"identity": {
|
|
"column": "kVersand",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2229"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kVersand",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2229",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kLieferschein",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kBenutzer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "kLogistik",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cIdentCode",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "dErstellt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cHinweis",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "fGewicht",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kVersandArt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cLogistiker",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cFulfillmentCenter",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "dAnkunftszeit",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nVerpackZeitSek",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "dVersendet",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nStatus",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cShipmentId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cReference",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cShipmentOrderId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "kKartonAuftragPos",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "cEnclosedReturnIdentCode",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "nViaAmazonMWS",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "kReturnVersandart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tVersandArt",
|
|
"ddl": "CREATE TABLE [dbo].[tVersandArt] (\n [kVersandArt] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [fPrice] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cAktiv] char(1) NULL,\n [cInet] char(1) NULL,\n [cZahlungsInfo] char(1) NULL,\n [fMwSt] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cDruckText] nvarchar(255) NULL,\n [fVKFreiAB] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cAuftragsText] nvarchar(255) NULL,\n [fZusatzGewicht] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nEigeneVersandart] tinyint NULL,\n [kMainVersandart] int NULL,\n [nVerwiegePflicht] tinyint NULL,\n [nTrackingIDEingabePflicht] tinyint NULL,\n [nExpress] tinyint DEFAULT ((0)) NOT NULL,\n [cTrackingIDRegex] nvarchar(1000) NULL,\n [nTrackingIDVon] tinyint DEFAULT ((1)) NOT NULL,\n [nTrackingIDBis] tinyint DEFAULT ((100)) NOT NULL,\n [nPrioritaet] int DEFAULT ((0)) NOT NULL,\n [nEtikettenDrucken] tinyint DEFAULT ((0)) NULL,\n [nEtikettenStartRueckfrage] tinyint DEFAULT ((0)) NULL,\n [kEtikettenFormular] int DEFAULT ((0)) NULL,\n [nVersandMailSenden] tinyint DEFAULT ((1)) NOT NULL,\n [nVersandSchnittstelle] tinyint DEFAULT ((1)) NOT NULL,\n [cTrackingUrlTemplate] nvarchar(255) NULL,\n [cAmazonCarrierCode] nvarchar(255) NULL,\n [cEbayCarrierCode] nvarchar(255) NULL,\n [kVersanddatenImportVorlage] int NULL,\n [kVersanddatenExportVorlage] int DEFAULT ((0)) NOT NULL,\n [kShippingServiceProviderType] tinyint NULL,\n [nAmazonPrime] tinyint DEFAULT ((0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [kSteuerklasse] int DEFAULT ((0)) NULL,\n [fEKPreis] decimal(25,13) DEFAULT ((0)) NOT NULL,\n [cMarktplatzLieferservice] nvarchar(255) NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kVersandArt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "fPrice",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cAktiv",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cZahlungsInfo",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "fMwSt",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cDruckText",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "fVKFreiAB",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cAuftragsText",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "fZusatzGewicht",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "nEigeneVersandart",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "kMainVersandart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nVerwiegePflicht",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nTrackingIDEingabePflicht",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "nExpress",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cTrackingIDRegex",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "nTrackingIDVon",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "nTrackingIDBis",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((100))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nPrioritaet",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nEtikettenDrucken",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "nEtikettenStartRueckfrage",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "kEtikettenFormular",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "nVersandMailSenden",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "nVersandSchnittstelle",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "cTrackingUrlTemplate",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "cAmazonCarrierCode",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "cEbayCarrierCode",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "kVersanddatenImportVorlage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
},
|
|
{
|
|
"columnName": "kVersanddatenExportVorlage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 30
|
|
},
|
|
{
|
|
"columnName": "kShippingServiceProviderType",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 31
|
|
},
|
|
{
|
|
"columnName": "nAmazonPrime",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 32
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 33
|
|
},
|
|
{
|
|
"columnName": "kSteuerklasse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 34
|
|
},
|
|
{
|
|
"columnName": "fEKPreis",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 35
|
|
},
|
|
{
|
|
"columnName": "cMarktplatzLieferservice",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 36
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tWarenLager",
|
|
"ddl": "CREATE TABLE [dbo].[tWarenLager] (\n [kWarenLager] int IDENTITY(1,1) NOT NULL,\n [cName] nvarchar(255) NULL,\n [cKuerzel] nvarchar(255) NULL,\n [cLagerTyp] nvarchar(255) NULL,\n [cBeschreibung] nvarchar(1024) NULL,\n [cStrasse] nvarchar(255) NULL,\n [cPLZ] nvarchar(255) NULL,\n [cOrt] nvarchar(255) NULL,\n [cLand] nvarchar(255) NULL,\n [cAnsprechpartnerAnrede] nvarchar(255) NULL,\n [cAnsprechpartnerVorname] nvarchar(255) NULL,\n [cAnsprechpartnerName] nvarchar(255) NULL,\n [cAnsprechpartnerTel] nvarchar(255) NULL,\n [cAnsprechpartnerFax] nvarchar(255) NULL,\n [cAnsprechpartnerEMail] nvarchar(255) NULL,\n [cAnsprechpartnerAbteilung] nvarchar(255) NULL,\n [cBundesland] nvarchar(100) NULL,\n [kFirma] int NULL,\n [kUser] int NULL,\n [nFulfillment] tinyint NOT NULL,\n [nLagerplatzVerwaltung] tinyint NOT NULL,\n [nAuslieferungsPrio] int DEFAULT ((0)) NULL,\n [nPackStationAktiv] tinyint NULL,\n [cDimension1Name] nvarchar(255) NULL,\n [cDimension1Trennzeichen] nvarchar(1) NULL,\n [nDimension1Laenge] tinyint NULL,\n [nDimension1Typ] tinyint NULL,\n [cDimension2Name] nvarchar(255) NULL,\n [cDimension2Trennzeichen] nvarchar(1) NULL,\n [nDimension2Laenge] tinyint NULL,\n [nDimension2Typ] tinyint NULL,\n [cDimension3Name] nvarchar(255) NULL,\n [cDimension3Trennzeichen] nvarchar(1) NULL,\n [nDimension3Laenge] tinyint NULL,\n [nDimension3Typ] tinyint NULL,\n [cDimension4Name] nvarchar(255) NULL,\n [cDimension4Trennzeichen] nvarchar(1) NULL,\n [nDimension4Laenge] tinyint NULL,\n [nDimension4Typ] tinyint NULL,\n [cDimension5Name] nvarchar(255) NULL,\n [cDimension5Trennzeichen] nvarchar(1) NULL,\n [nDimension5Laenge] tinyint NULL,\n [nDimension5Typ] tinyint NULL,\n [cEmpfaengerFirma] nvarchar(255) NULL,\n [kQuellLager] int DEFAULT ((0)) NOT NULL,\n [kZielLager] int DEFAULT ((0)) NOT NULL,\n [nAktiv] tinyint DEFAULT ((0)) NOT NULL,\n [cFfnWarehouseId] nvarchar(50) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cAdresszusatz] nvarchar(255) NULL\n)",
|
|
"identity": {
|
|
"column": "kWarenLager",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "1"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kWarenLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "1",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cKuerzel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cLagerTyp",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cBeschreibung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2048,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cStrasse",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cPLZ",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cOrt",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cLand",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerAnrede",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerVorname",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerTel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerFax",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerEMail",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cAnsprechpartnerAbteilung",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cBundesland",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "kFirma",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "kUser",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nFulfillment",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nLagerplatzVerwaltung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "nAuslieferungsPrio",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "nPackStationAktiv",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "cDimension1Name",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "cDimension1Trennzeichen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "nDimension1Laenge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "nDimension1Typ",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "cDimension2Name",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "cDimension2Trennzeichen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
},
|
|
{
|
|
"columnName": "nDimension2Laenge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 30
|
|
},
|
|
{
|
|
"columnName": "nDimension2Typ",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 31
|
|
},
|
|
{
|
|
"columnName": "cDimension3Name",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 32
|
|
},
|
|
{
|
|
"columnName": "cDimension3Trennzeichen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 33
|
|
},
|
|
{
|
|
"columnName": "nDimension3Laenge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 34
|
|
},
|
|
{
|
|
"columnName": "nDimension3Typ",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 35
|
|
},
|
|
{
|
|
"columnName": "cDimension4Name",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 36
|
|
},
|
|
{
|
|
"columnName": "cDimension4Trennzeichen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 37
|
|
},
|
|
{
|
|
"columnName": "nDimension4Laenge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 38
|
|
},
|
|
{
|
|
"columnName": "nDimension4Typ",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 39
|
|
},
|
|
{
|
|
"columnName": "cDimension5Name",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 40
|
|
},
|
|
{
|
|
"columnName": "cDimension5Trennzeichen",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 41
|
|
},
|
|
{
|
|
"columnName": "nDimension5Laenge",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 42
|
|
},
|
|
{
|
|
"columnName": "nDimension5Typ",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 43
|
|
},
|
|
{
|
|
"columnName": "cEmpfaengerFirma",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 44
|
|
},
|
|
{
|
|
"columnName": "kQuellLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 45
|
|
},
|
|
{
|
|
"columnName": "kZielLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 46
|
|
},
|
|
{
|
|
"columnName": "nAktiv",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 47
|
|
},
|
|
{
|
|
"columnName": "cFfnWarehouseId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 48
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 49
|
|
},
|
|
{
|
|
"columnName": "cAdresszusatz",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 50
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tWarenLagerPlatz",
|
|
"ddl": "CREATE TABLE [dbo].[tWarenLagerPlatz] (\n [kWarenLagerPlatz] int IDENTITY(1,1) NOT NULL,\n [kWarenLager] int NOT NULL,\n [fGewichtMax] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cKommentar] nvarchar(MAX) NULL,\n [fLaenge] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fBreite] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fHoehe] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nSort] int NULL,\n [cName] nvarchar(50) NULL,\n [kWarenLagerPlatzTyp] int NULL,\n [nStatus] int DEFAULT ((0)) NOT NULL,\n [dWmsInventurDatum] datetime NULL,\n [kWmsInventur] int NULL,\n [nPreInvStatus] int NULL,\n [nInvGezaehlt] tinyint DEFAULT ((0)) NULL,\n [nGesperrt] tinyint DEFAULT ((0)) NOT NULL,\n [nPrio] int DEFAULT ((0)) NOT NULL,\n [nAuslieferungGesperrt] bit DEFAULT ((0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": {
|
|
"column": "kWarenLagerPlatz",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "2"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kWarenLagerPlatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "2",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kWarenLager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "fGewichtMax",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cKommentar",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "fLaenge",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "fBreite",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "fHoehe",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nSort",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "kWarenLagerPlatzTyp",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "nStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "dWmsInventurDatum",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "kWmsInventur",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nPreInvStatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nInvGezaehlt",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "nGesperrt",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "nPrio",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "nAuslieferungGesperrt",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tZahlung",
|
|
"ddl": "CREATE TABLE [dbo].[tZahlung] (\n [kZahlung] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [dDatum] datetime NULL,\n [fBetrag] decimal(25,13) DEFAULT ((0)) NOT NULL,\n [kBestellung] int NULL,\n [kBenutzer] int NULL,\n [nAnzahlung] tinyint DEFAULT ((0)) NULL,\n [cHinweis] nvarchar(2000) NULL,\n [kZahlungsart] int NULL,\n [nKeinExport] tinyint NULL,\n [cSKRManuell] nvarchar(255) NULL,\n [cExternalTransactionId] nvarchar(255) NULL,\n [kZahlungsabgleichUmsatz] int NULL,\n [nZuweisungstyp] tinyint NULL,\n [nZahlungstyp] tinyint NOT NULL,\n [cZuweisungsinfo] nvarchar(1000) NULL,\n [nZuweisungswertung] int NULL,\n [kRechnung] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [kGutschrift] int NULL,\n [kEingangsrechnung] int NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kZahlung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "dDatum",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "fBetrag",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "kBestellung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "kBenutzer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "nAnzahlung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cHinweis",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 4000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "kZahlungsart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "nKeinExport",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cSKRManuell",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cExternalTransactionId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "kZahlungsabgleichUmsatz",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nZuweisungstyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nZahlungstyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cZuweisungsinfo",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 2000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "nZuweisungswertung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "kRechnung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "kGutschrift",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "kEingangsrechnung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tZahlungsArtSprache",
|
|
"ddl": "CREATE TABLE [dbo].[tZahlungsArtSprache] (\n [kZahlungsart] int NOT NULL,\n [kSprache] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [cPrtString] nvarchar(MAX) NULL,\n [cPrtStringVor] nvarchar(MAX) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kZahlungsart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cPrtString",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cPrtStringVor",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tZahlungsart",
|
|
"ddl": "CREATE TABLE [dbo].[tZahlungsart] (\n [kZahlungsart] int NOT NULL,\n [cName] nvarchar(255) NULL,\n [cPrtString] nvarchar(MAX) NULL,\n [nLastschrift] tinyint NULL,\n [cPrtStringVor] nvarchar(MAX) NULL,\n [cPaymentOption] nvarchar(255) NULL,\n [cKonto] nvarchar(32) NULL,\n [nAusliefernVorZahlung] tinyint NULL,\n [nPrioritaet] tinyint DEFAULT ((0)) NOT NULL,\n [nMahnwesenAktiv] tinyint DEFAULT ((0)) NOT NULL,\n [fSkontoWert] decimal(25,13) NULL,\n [nSkontoZeitraum] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nMatchingOptionen] tinyint DEFAULT ((0)) NOT NULL,\n [nIstStandard] bit DEFAULT ((0)) NOT NULL,\n [nAktiv] bit DEFAULT ((1)) NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kZahlungsart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cPrtString",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "nLastschrift",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cPrtStringVor",
|
|
"typeName": "nvarchar",
|
|
"maxLength": -1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cPaymentOption",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cKonto",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 64,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nAusliefernVorZahlung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "nPrioritaet",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "nMahnwesenAktiv",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "fSkontoWert",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "nSkontoZeitraum",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nMatchingOptionen",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nIstStandard",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "nAktiv",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "dbo",
|
|
"table": "tpk",
|
|
"ddl": "CREATE TABLE [dbo].[tpk] (\n [cName] nvarchar(255) NOT NULL,\n [nummer] int NULL,\n [dChanged] nvarchar(20) NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "nummer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "dChanged",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Pos",
|
|
"table": "tAuftragMapping",
|
|
"ddl": "CREATE TABLE [Pos].[tAuftragMapping] (\n [kAuftrag] int NULL,\n [kPosAuftrag] int NOT NULL,\n [kShopSubShop] int NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kPosAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kShopSubShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Pos",
|
|
"table": "tAuftragPositionMapping",
|
|
"ddl": "CREATE TABLE [Pos].[tAuftragPositionMapping] (\n [kAuftragPosition] int NOT NULL,\n [kPosAuftragPosition] int NOT NULL,\n [kShopSubShop] int NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftragPosition",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kPosAuftragPosition",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kShopSubShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Verkauf",
|
|
"table": "tAuftrag",
|
|
"ddl": "CREATE TABLE [Verkauf].[tAuftrag] (\n [kAuftrag] int IDENTITY(1,1) NOT NULL,\n [kBenutzer] int NOT NULL,\n [kKunde] int NULL,\n [cAuftragsNr] nvarchar(50) NOT NULL,\n [nType] tinyint NOT NULL,\n [dErstellt] datetime DEFAULT (getdate()) NOT NULL,\n [kShopauftrag] int NULL,\n [nBeschreibung] tinyint DEFAULT ((0)) NOT NULL,\n [cInet] char(1) NULL,\n [cWaehrung] char(3) NULL,\n [fFaktor] decimal(25,13) NOT NULL,\n [kShop] int NULL,\n [kFirmaHistory] int NOT NULL,\n [kPlattform] int NULL,\n [kSprache] int NOT NULL,\n [cExterneAuftragsnummer] nvarchar(50) NULL,\n [nSteuereinstellung] int DEFAULT ((0)) NULL,\n [cEbayUsername] nvarchar(255) NULL,\n [cShopZahlungsmodul] nvarchar(255) NULL,\n [nHatUpload] bit DEFAULT ((0)) NOT NULL,\n [fZusatzGewicht] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [cVersandlandISO] nvarchar(5) NULL,\n [cVersandlandBundeslandKuerzel] nvarchar(5) NULL,\n [cVersandlandWaehrung] char(3) NOT NULL,\n [fVersandlandWaehrungFaktor] decimal(25,13) NOT NULL,\n [kVersandArt] int NULL,\n [nZahlungszielTage] int NULL,\n [dVoraussichtlichesLieferdatum] datetime NULL,\n [dAuslieferdatum] datetime NULL,\n [fSkonto] decimal(25,13) NULL,\n [nSkontoTage] int NULL,\n [kVorgangsstatus] int NULL,\n [nStorno] bit DEFAULT ((0)) NOT NULL,\n [nKomplettAusgeliefert] int DEFAULT ((0)) NOT NULL,\n [nLieferPrioritaet] int DEFAULT ((0)) NOT NULL,\n [nPremiumVersand] bit DEFAULT ((0)) NOT NULL,\n [kRueckhaltegrund] int NULL,\n [kZahlungsart] int NULL,\n [kWarenlager] int NULL,\n [nIstExterneRechnung] tinyint DEFAULT ((0)) NOT NULL,\n [nIstReadOnly] tinyint DEFAULT ((0)) NOT NULL,\n [nMaxLiefertage] int NULL,\n [cOutboundId] nvarchar(255) NULL,\n [kFulfillmentLieferant] int NULL,\n [cUstId] nvarchar(25) NULL,\n [nArchiv] bit DEFAULT ((0)) NOT NULL,\n [nReserviert] bit DEFAULT ((0)) NOT NULL,\n [nDebitorennr] int NULL,\n [nAuftragStatus] tinyint DEFAULT ((0)) NOT NULL,\n [cKundenAuftragsnummer] nvarchar(250) NULL,\n [cAmazonServiceLevel] nvarchar(100) NULL,\n [dExternesErstelldatum] datetime NULL,\n [kFarbe] int NULL,\n [fFinanzierungskosten] decimal(25,13) NOT NULL,\n [kAuftragQuelle] int NULL,\n [nAuftragQuelleAktion] int NULL,\n [kArtikelKarton] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [cKundenNr] nvarchar(30) NULL,\n [kKundengruppe] int NULL,\n [dErstelltWawi] datetime DEFAULT (getdate()) NULL,\n [dAuslieferungAb] datetime NULL,\n [kAmazonUser] int NULL,\n [cKundeUstId] nvarchar(20) NULL,\n [nPending] bit DEFAULT ((0)) NOT NULL,\n [kBenutzerErstellt] int NOT NULL,\n [nSteuersonderbehandlung] tinyint DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": {
|
|
"column": "kAuftrag",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3233"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3233",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kBenutzer",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kKunde",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cAuftragsNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nType",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "dErstellt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "(getdate())",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "kShopauftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "nBeschreibung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cInet",
|
|
"typeName": "char",
|
|
"maxLength": 1,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cWaehrung",
|
|
"typeName": "char",
|
|
"maxLength": 3,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "fFaktor",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "kShop",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "kFirmaHistory",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "kPlattform",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "kSprache",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cExterneAuftragsnummer",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 100,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "nSteuereinstellung",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cEbayUsername",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "cShopZahlungsmodul",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nHatUpload",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "fZusatzGewicht",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "cVersandlandISO",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 10,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "cVersandlandBundeslandKuerzel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 10,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "cVersandlandWaehrung",
|
|
"typeName": "char",
|
|
"maxLength": 3,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "fVersandlandWaehrungFaktor",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "kVersandArt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "nZahlungszielTage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "dVoraussichtlichesLieferdatum",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "dAuslieferdatum",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
},
|
|
{
|
|
"columnName": "fSkonto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 30
|
|
},
|
|
{
|
|
"columnName": "nSkontoTage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 31
|
|
},
|
|
{
|
|
"columnName": "kVorgangsstatus",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 32
|
|
},
|
|
{
|
|
"columnName": "nStorno",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 33
|
|
},
|
|
{
|
|
"columnName": "nKomplettAusgeliefert",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 34
|
|
},
|
|
{
|
|
"columnName": "nLieferPrioritaet",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 35
|
|
},
|
|
{
|
|
"columnName": "nPremiumVersand",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 36
|
|
},
|
|
{
|
|
"columnName": "kRueckhaltegrund",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 37
|
|
},
|
|
{
|
|
"columnName": "kZahlungsart",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 38
|
|
},
|
|
{
|
|
"columnName": "kWarenlager",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 39
|
|
},
|
|
{
|
|
"columnName": "nIstExterneRechnung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 40
|
|
},
|
|
{
|
|
"columnName": "nIstReadOnly",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 41
|
|
},
|
|
{
|
|
"columnName": "nMaxLiefertage",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 42
|
|
},
|
|
{
|
|
"columnName": "cOutboundId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 43
|
|
},
|
|
{
|
|
"columnName": "kFulfillmentLieferant",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 44
|
|
},
|
|
{
|
|
"columnName": "cUstId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 50,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 45
|
|
},
|
|
{
|
|
"columnName": "nArchiv",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 46
|
|
},
|
|
{
|
|
"columnName": "nReserviert",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 47
|
|
},
|
|
{
|
|
"columnName": "nDebitorennr",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 48
|
|
},
|
|
{
|
|
"columnName": "nAuftragStatus",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 49
|
|
},
|
|
{
|
|
"columnName": "cKundenAuftragsnummer",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 500,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 50
|
|
},
|
|
{
|
|
"columnName": "cAmazonServiceLevel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 51
|
|
},
|
|
{
|
|
"columnName": "dExternesErstelldatum",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 52
|
|
},
|
|
{
|
|
"columnName": "kFarbe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 53
|
|
},
|
|
{
|
|
"columnName": "fFinanzierungskosten",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 54
|
|
},
|
|
{
|
|
"columnName": "kAuftragQuelle",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 55
|
|
},
|
|
{
|
|
"columnName": "nAuftragQuelleAktion",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 56
|
|
},
|
|
{
|
|
"columnName": "kArtikelKarton",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 57
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 58
|
|
},
|
|
{
|
|
"columnName": "cKundenNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 59
|
|
},
|
|
{
|
|
"columnName": "kKundengruppe",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 60
|
|
},
|
|
{
|
|
"columnName": "dErstelltWawi",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "(getdate())",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 61
|
|
},
|
|
{
|
|
"columnName": "dAuslieferungAb",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 62
|
|
},
|
|
{
|
|
"columnName": "kAmazonUser",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 63
|
|
},
|
|
{
|
|
"columnName": "cKundeUstId",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 40,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 64
|
|
},
|
|
{
|
|
"columnName": "nPending",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 65
|
|
},
|
|
{
|
|
"columnName": "kBenutzerErstellt",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 66
|
|
},
|
|
{
|
|
"columnName": "nSteuersonderbehandlung",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 67
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Verkauf",
|
|
"table": "tAuftragAdresse",
|
|
"ddl": "CREATE TABLE [Verkauf].[tAuftragAdresse] (\n [kAuftrag] int NOT NULL,\n [kKunde] int NULL,\n [cFirma] nvarchar(128) NULL,\n [cAnrede] nvarchar(30) NULL,\n [cTitel] nvarchar(64) NULL,\n [cVorname] nvarchar(255) NULL,\n [cName] nvarchar(255) NULL,\n [cStrasse] nvarchar(255) NULL,\n [cPLZ] nvarchar(24) NULL,\n [cOrt] nvarchar(255) NULL,\n [cLand] nvarchar(255) NULL,\n [cTel] nvarchar(30) NULL,\n [cZusatz] nvarchar(60) NULL,\n [cAdressZusatz] nvarchar(255) NULL,\n [cPostID] nvarchar(255) NULL,\n [cMobil] nvarchar(30) NULL,\n [cMail] nvarchar(255) NULL,\n [cFax] nvarchar(30) NULL,\n [cBundesland] nvarchar(255) NULL,\n [cISO] nvarchar(5) NULL,\n [nTyp] tinyint DEFAULT ((0)) NOT NULL,\n [nZolldokumenteErforderlich] tinyint NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kKunde",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "cFirma",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 256,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cAnrede",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "cTitel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 128,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cVorname",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "cStrasse",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "cPLZ",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 48,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "cOrt",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "cLand",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "cTel",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "cZusatz",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 120,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "cAdressZusatz",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "cPostID",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "cMobil",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cMail",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "cFax",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 60,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "cBundesland",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "cISO",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 10,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nTyp",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "nZolldokumenteErforderlich",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Verkauf",
|
|
"table": "tAuftragEckdaten",
|
|
"ddl": "CREATE TABLE [Verkauf].[tAuftragEckdaten] (\n [kAuftrag] int NOT NULL,\n [dLetzterVersand] datetime NULL,\n [dGedruckt] datetime NULL,\n [dGemailt] datetime NULL,\n [dVersandMail] datetime NULL,\n [dZahlungsMail] datetime NULL,\n [fWertNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fWertBrutto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fZahlung] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fGutschrift] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [nIstNachnahme] bit DEFAULT ((0)) NOT NULL,\n [dBezahlt] datetime NULL,\n [nIstKomplettRetourniert] bit DEFAULT ((0)) NOT NULL,\n [nRechnungStatus] tinyint DEFAULT ((0)) NOT NULL,\n [nZahlungStatus] tinyint DEFAULT ((0)) NOT NULL,\n [nAnzahlPakete] int DEFAULT ((0)) NOT NULL,\n [fWertRechnungNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fWertRechnungBrutto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [nAnzahlVersendetePakete] int DEFAULT ((0)) NOT NULL,\n [nIstFuerAuslieferungGesperrt] tinyint DEFAULT ((0)) NOT NULL,\n [cRechnungsnummern] nvarchar(200) NULL,\n [fOffenerWert] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fOffenerWertOhneStorno] decimal(25,13) DEFAULT ((0)) NOT NULL\n)",
|
|
"identity": null,
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "dLetzterVersand",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "dGedruckt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "dGemailt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "dVersandMail",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "dZahlungsMail",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "fWertNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "fWertBrutto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "fZahlung",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "fGutschrift",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "nIstNachnahme",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "dBezahlt",
|
|
"typeName": "datetime",
|
|
"maxLength": 8,
|
|
"precision": 23,
|
|
"scale": 3,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nIstKomplettRetourniert",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "nRechnungStatus",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "nZahlungStatus",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "nAnzahlPakete",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "fWertRechnungNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "fWertRechnungBrutto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "nAnzahlVersendetePakete",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "nIstFuerAuslieferungGesperrt",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "cRechnungsnummern",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 400,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "fOffenerWert",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "fOffenerWertOhneStorno",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"schema": "Verkauf",
|
|
"table": "tAuftragPosition",
|
|
"ddl": "CREATE TABLE [Verkauf].[tAuftragPosition] (\n [kAuftragPosition] int IDENTITY(1,1) NOT NULL,\n [kArtikel] int NULL,\n [kAuftrag] int NOT NULL,\n [cArtNr] nvarchar(100) NULL,\n [nReserviert] bit DEFAULT ((0)) NOT NULL,\n [cName] nvarchar(255) NULL,\n [cHinweis] nvarchar(2000) NULL,\n [fAnzahl] decimal(25,13) NOT NULL,\n [fEkNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fVkNetto] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fRabatt] decimal(25,13) DEFAULT ((0.0)) NOT NULL,\n [fMwSt] decimal(25,13) NOT NULL,\n [nSort] int DEFAULT ((0)) NOT NULL,\n [cNameStandard] nvarchar(255) NULL,\n [kSteuerklasse] int NULL,\n [nType] tinyint NOT NULL,\n [cEinheit] nvarchar(255) NULL,\n [nHatUpload] bit DEFAULT ((0)) NOT NULL,\n [kKonfigVater] int NULL,\n [kKonfigItem] int NULL,\n [kAmazonBestellungPos] int NULL,\n [kAuftragStueckliste] int NULL,\n [kEbayTransaction] int NULL,\n [fFaktor] decimal(25,13) DEFAULT ((1.0)) NOT NULL,\n [kSteuerschluessel] int NULL,\n [bRowversion] binary(8) NOT NULL /* was rowversion; stored as binary(8) for restore */,\n [fWertNettoGesamtFixiert] decimal(25,13) NULL,\n [fWertBruttoGesamtFixiert] decimal(25,13) NULL,\n [cFNSKU] nvarchar(255) NULL\n)",
|
|
"identity": {
|
|
"column": "kAuftragPosition",
|
|
"seed": "1",
|
|
"increment": "1",
|
|
"lastValue": "3633"
|
|
},
|
|
"columns": [
|
|
{
|
|
"columnName": "kAuftragPosition",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": true,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": "1",
|
|
"identityIncrement": "1",
|
|
"identityLastValue": "3633",
|
|
"columnId": 1
|
|
},
|
|
{
|
|
"columnName": "kArtikel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 2
|
|
},
|
|
{
|
|
"columnName": "kAuftrag",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 3
|
|
},
|
|
{
|
|
"columnName": "cArtNr",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 200,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 4
|
|
},
|
|
{
|
|
"columnName": "nReserviert",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 5
|
|
},
|
|
{
|
|
"columnName": "cName",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 6
|
|
},
|
|
{
|
|
"columnName": "cHinweis",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 4000,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 7
|
|
},
|
|
{
|
|
"columnName": "fAnzahl",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 8
|
|
},
|
|
{
|
|
"columnName": "fEkNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 9
|
|
},
|
|
{
|
|
"columnName": "fVkNetto",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 10
|
|
},
|
|
{
|
|
"columnName": "fRabatt",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 11
|
|
},
|
|
{
|
|
"columnName": "fMwSt",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 12
|
|
},
|
|
{
|
|
"columnName": "nSort",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 13
|
|
},
|
|
{
|
|
"columnName": "cNameStandard",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 14
|
|
},
|
|
{
|
|
"columnName": "kSteuerklasse",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 15
|
|
},
|
|
{
|
|
"columnName": "nType",
|
|
"typeName": "tinyint",
|
|
"maxLength": 1,
|
|
"precision": 3,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 16
|
|
},
|
|
{
|
|
"columnName": "cEinheit",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 17
|
|
},
|
|
{
|
|
"columnName": "nHatUpload",
|
|
"typeName": "bit",
|
|
"maxLength": 1,
|
|
"precision": 1,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 18
|
|
},
|
|
{
|
|
"columnName": "kKonfigVater",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 19
|
|
},
|
|
{
|
|
"columnName": "kKonfigItem",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 20
|
|
},
|
|
{
|
|
"columnName": "kAmazonBestellungPos",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 21
|
|
},
|
|
{
|
|
"columnName": "kAuftragStueckliste",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 22
|
|
},
|
|
{
|
|
"columnName": "kEbayTransaction",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 23
|
|
},
|
|
{
|
|
"columnName": "fFaktor",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": "((1.0))",
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 24
|
|
},
|
|
{
|
|
"columnName": "kSteuerschluessel",
|
|
"typeName": "int",
|
|
"maxLength": 4,
|
|
"precision": 10,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 25
|
|
},
|
|
{
|
|
"columnName": "bRowversion",
|
|
"typeName": "timestamp",
|
|
"maxLength": 8,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": false,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": true,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 26
|
|
},
|
|
{
|
|
"columnName": "fWertNettoGesamtFixiert",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 27
|
|
},
|
|
{
|
|
"columnName": "fWertBruttoGesamtFixiert",
|
|
"typeName": "decimal",
|
|
"maxLength": 13,
|
|
"precision": 25,
|
|
"scale": 13,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 28
|
|
},
|
|
{
|
|
"columnName": "cFNSKU",
|
|
"typeName": "nvarchar",
|
|
"maxLength": 510,
|
|
"precision": 0,
|
|
"scale": 0,
|
|
"isNullable": true,
|
|
"isIdentity": false,
|
|
"isComputed": false,
|
|
"isRowversion": false,
|
|
"computedDefinition": null,
|
|
"isPersisted": false,
|
|
"defaultDefinition": null,
|
|
"identitySeed": null,
|
|
"identityIncrement": null,
|
|
"identityLastValue": null,
|
|
"columnId": 29
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "PK_dbo_tArtikel",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikel] ADD CONSTRAINT [PK_dbo_tArtikel] PRIMARY KEY CLUSTERED ([kArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "UQ_dbo_tArtikel_cArtNr",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikel] ADD CONSTRAINT [UQ_dbo_tArtikel_cArtNr] UNIQUE NONCLUSTERED ([cArtNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_dbo_tArtikel_nIstVater_kStueckliste_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikel_nIstVater_kStueckliste_INCL] ON [dbo].[tArtikel] ([nIstVater] ASC, [kStueckliste] ASC) INCLUDE ([kArtikel], [fEKNetto]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_dbo_tArtikel_nSonderTyp",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikel_nSonderTyp] ON [dbo].[tArtikel] ([nSonderTyp] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cAktiv_cLagerAktiv_cLagerVariation_nIstVater_kStueckliste",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cAktiv_cLagerAktiv_cLagerVariation_nIstVater_kStueckliste] ON [dbo].[tArtikel] ([cAktiv] ASC, [cLagerAktiv] ASC, [cLagerVariation] ASC, [nIstVater] ASC, [kStueckliste] ASC) INCLUDE ([cBarcode], [cArtNr]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cASIN",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cASIN] ON [dbo].[tArtikel] ([cASIN] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cBarcode",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cBarcode] ON [dbo].[tArtikel] ([cBarcode] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cHAN",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cHAN] ON [dbo].[tArtikel] ([cHAN] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cISBN",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cISBN] ON [dbo].[tArtikel] ([cISBN] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cLagerAktiv_cLagerVariation_nIstTeilmengenArtikel_nIstVater_FILTER",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cLagerAktiv_cLagerVariation_nIstTeilmengenArtikel_nIstVater_FILTER] ON [dbo].[tArtikel] ([cLagerAktiv] ASC, [cLagerVariation] ASC, [nIstTeilmengenArtikel] ASC, [nIstVater] ASC) WHERE ([nIstVater]=(0)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tartikel_cLagerAktiv_nIstVater_kStueckliste_cLagerVariation",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tartikel_cLagerAktiv_nIstVater_kStueckliste_cLagerVariation] ON [dbo].[tArtikel] ([cLagerAktiv] ASC, [nIstVater] ASC, [kStueckliste] ASC, [cLagerVariation] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cSerie",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cSerie] ON [dbo].[tArtikel] ([cSerie] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_cSuchbegriffe",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_cSuchbegriffe] ON [dbo].[tArtikel] ([cSuchbegriffe] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_fEKNetto",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_fEKNetto] ON [dbo].[tArtikel] ([fEKNetto] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kArtikel_INCL2",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kArtikel_INCL2] ON [dbo].[tArtikel] ([kArtikel] ASC) INCLUDE ([kStueckliste], [kVaterArtikel], [nIstVater], [cLagerVariation], [cTeilbar], [nPuffer], [cLagerKleinerNull], [cLagerAktiv], [fGewicht], [fArtGewicht]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kEigenschaftKombi",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kEigenschaftKombi] ON [dbo].[tArtikel] ([kEigenschaftKombi] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kHersteller",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kHersteller] ON [dbo].[tArtikel] ([kHersteller] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kStueckliste_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kStueckliste_INCL] ON [dbo].[tArtikel] ([kStueckliste] ASC) INCLUDE ([cTeilbar], [cArtNr]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kVaterArtikel_cAktiv_nIstMindestbestand",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kVaterArtikel_cAktiv_nIstMindestbestand] ON [dbo].[tArtikel] ([kVaterArtikel] ASC, [cAktiv] ASC, [nIstMindestbestand] ASC) INCLUDE ([kArtikel], [cArtNr], [nMidestbestand], [kStueckliste]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kVaterArtikel_nIstVater",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kVaterArtikel_nIstVater] ON [dbo].[tArtikel] ([kVaterArtikel] ASC, [nIstVater] ASC) INCLUDE ([cLagerAktiv]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"indexName": "IX_tArtikel_kWarengruppe",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikel_kWarengruppe] ON [dbo].[tArtikel] ([kWarengruppe] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"indexName": "PK_dbo_tArtikelAttribut",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelAttribut] ADD CONSTRAINT [PK_dbo_tArtikelAttribut] PRIMARY KEY CLUSTERED ([kArtikelAttribut] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"indexName": "UQ_dbo_tArtikelAttribut_kArtikel_kAttribut_kShop",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelAttribut] ADD CONSTRAINT [UQ_dbo_tArtikelAttribut_kArtikel_kAttribut_kShop] UNIQUE NONCLUSTERED ([kArtikel] ASC, [kAttribut] ASC, [kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"indexName": "IX_dbo_tArtikelAttribut_kArtikel",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelAttribut_kArtikel] ON [dbo].[tArtikelAttribut] ([kArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"indexName": "IX_dbo_tArtikelAttribut_kAttribut_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelAttribut_kAttribut_INCL] ON [dbo].[tArtikelAttribut] ([kAttribut] ASC) INCLUDE ([kArtikel]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttributSprache",
|
|
"indexName": "PK_dbo_tArtikelAttributSprache",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelAttributSprache] ADD CONSTRAINT [PK_dbo_tArtikelAttributSprache] PRIMARY KEY CLUSTERED ([kArtikelAttribut] ASC, [kSprache] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"indexName": "PK_dbo_tArtikelBeschreibung",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelBeschreibung] ADD CONSTRAINT [PK_dbo_tArtikelBeschreibung] PRIMARY KEY CLUSTERED ([kArtikel] ASC, [kSprache] ASC, [kPlattform] ASC, [kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"indexName": "IX_tArtikelBeschreibung_kArtikel_kPlattform_kSprache_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikelBeschreibung_kArtikel_kPlattform_kSprache_INCL] ON [dbo].[tArtikelBeschreibung] ([kArtikel] ASC, [kPlattform] ASC, [kSprache] ASC) INCLUDE ([cBeschreibung], [cKurzBeschreibung], [cMetaDescription], [cMetaKeywords], [cName], [cTitleTag]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"indexName": "IX_tArtikelbeschreibung_kArtikel_kSprache_kPlattform",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikelbeschreibung_kArtikel_kSprache_kPlattform] ON [dbo].[tArtikelBeschreibung] ([kArtikel] ASC, [kSprache] ASC, [kPlattform] ASC) INCLUDE ([cName]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"indexName": "IX_tArtikelBeschreibung_kPlattform_INCL_kArtikel_kSprache",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikelBeschreibung_kPlattform_INCL_kArtikel_kSprache] ON [dbo].[tArtikelBeschreibung] ([kPlattform] ASC) INCLUDE ([kArtikel], [kSprache]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"indexName": "IX_tArtikelBeschreibung_kSprache_kPlattform",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tArtikelBeschreibung_kSprache_kPlattform] ON [dbo].[tArtikelBeschreibung] ([kSprache] ASC, [kPlattform] ASC) INCLUDE ([kArtikel], [cName]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "PK_dbo_tArtikelbildPlattform",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelbildPlattform] ADD CONSTRAINT [PK_dbo_tArtikelbildPlattform] PRIMARY KEY CLUSTERED ([kArtikelbildPlattform] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "UQ_dbo_tArtikelbildPlattform_kBild_kArtikel_kPlattform_kShop_kEbayUser",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelbildPlattform] ADD CONSTRAINT [UQ_dbo_tArtikelbildPlattform_kBild_kArtikel_kPlattform_kShop_kEbayUser] UNIQUE NONCLUSTERED ([kBild] ASC, [kArtikel] ASC, [kPlattform] ASC, [kShop] ASC, [kEbayUser] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "UQ_dbo_tArtikelbildPlattform_kArtikel_kPlattform_kShop_kEbayUser_nNr",
|
|
"ddl": "ALTER TABLE [dbo].[tArtikelbildPlattform] ADD CONSTRAINT [UQ_dbo_tArtikelbildPlattform_kArtikel_kPlattform_kShop_kEbayUser_nNr] UNIQUE NONCLUSTERED ([kArtikel] ASC, [kPlattform] ASC, [kShop] ASC, [kEbayUser] ASC, [nNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "IX_dbo_tArtikelbildPlattform_kArtikel_kBild",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelbildPlattform_kArtikel_kBild] ON [dbo].[tArtikelbildPlattform] ([kArtikel] ASC, [kBild] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "IX_dbo_tArtikelbildPlattform_kBild",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelbildPlattform_kBild] ON [dbo].[tArtikelbildPlattform] ([kBild] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "IX_dbo_tArtikelbildPlattform_kPlattform_nNr",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelbildPlattform_kPlattform_nNr] ON [dbo].[tArtikelbildPlattform] ([kPlattform] ASC, [nNr] ASC) INCLUDE ([kBild], [kArtikel]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"indexName": "IX_dbo_tArtikelbildPlattform_nNr_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tArtikelbildPlattform_nNr_INCL] ON [dbo].[tArtikelbildPlattform] ([nNr] ASC) INCLUDE ([kArtikel], [kBild], [kPlattform]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttribut",
|
|
"indexName": "PK_dbo_tAttribut",
|
|
"ddl": "ALTER TABLE [dbo].[tAttribut] ADD CONSTRAINT [PK_dbo_tAttribut] PRIMARY KEY CLUSTERED ([kAttribut] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttributSprache",
|
|
"indexName": "PK_dbo_tAttributSprache",
|
|
"ddl": "ALTER TABLE [dbo].[tAttributSprache] ADD CONSTRAINT [PK_dbo_tAttributSprache] PRIMARY KEY CLUSTERED ([kAttribut] ASC, [kSprache] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tBild",
|
|
"indexName": "PK_dbo_tBild",
|
|
"ddl": "ALTER TABLE [dbo].[tBild] ADD CONSTRAINT [PK_dbo_tBild] PRIMARY KEY CLUSTERED ([kBild] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tBild",
|
|
"indexName": "IX_tBild_cHash",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tBild_cHash] ON [dbo].[tBild] ([cHash] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tFirmaHistory",
|
|
"indexName": "PK_dbo_tFirmaHistory",
|
|
"ddl": "ALTER TABLE [dbo].[tFirmaHistory] ADD CONSTRAINT [PK_dbo_tFirmaHistory] PRIMARY KEY CLUSTERED ([kFirmaHistory] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"indexName": "PK_dbo_tkategorie",
|
|
"ddl": "ALTER TABLE [dbo].[tkategorie] ADD CONSTRAINT [PK_dbo_tkategorie] PRIMARY KEY CLUSTERED ([kKategorie] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"indexName": "IX_tkategorie_cAktiv",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tkategorie_cAktiv] ON [dbo].[tkategorie] ([cAktiv] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"indexName": "IX_tkategorie_kOberKategorie",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tkategorie_kOberKategorie] ON [dbo].[tkategorie] ([kOberKategorie] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"indexName": "IX_tkategorie_nSort",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tkategorie_nSort] ON [dbo].[tkategorie] ([nSort] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorieartikel",
|
|
"indexName": "PK_dbo_tkategorieartikel",
|
|
"ddl": "ALTER TABLE [dbo].[tkategorieartikel] ADD CONSTRAINT [PK_dbo_tkategorieartikel] PRIMARY KEY CLUSTERED ([kKategorieArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorieartikel",
|
|
"indexName": "UQ_dbo_tkategorieartikel_kArtikel_kKategorie",
|
|
"ddl": "ALTER TABLE [dbo].[tkategorieartikel] ADD CONSTRAINT [UQ_dbo_tkategorieartikel_kArtikel_kKategorie] UNIQUE NONCLUSTERED ([kArtikel] ASC, [kKategorie] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategoriebildPlattform",
|
|
"indexName": "PK_dbo_tKategoriebildPlattform",
|
|
"ddl": "ALTER TABLE [dbo].[tKategoriebildPlattform] ADD CONSTRAINT [PK_dbo_tKategoriebildPlattform] PRIMARY KEY CLUSTERED ([kKategoriebildPlattform] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategoriebildPlattform",
|
|
"indexName": "UQ_dbo_tKategoriebildPlattform_kKategorie_kPlattform_kShop_nNr",
|
|
"ddl": "ALTER TABLE [dbo].[tKategoriebildPlattform] ADD CONSTRAINT [UQ_dbo_tKategoriebildPlattform_kKategorie_kPlattform_kShop_nNr] UNIQUE NONCLUSTERED ([kKategorie] ASC, [kPlattform] ASC, [kShop] ASC, [nNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieShop",
|
|
"indexName": "PK_dbo_tKategorieShop",
|
|
"ddl": "ALTER TABLE [dbo].[tKategorieShop] ADD CONSTRAINT [PK_dbo_tKategorieShop] PRIMARY KEY CLUSTERED ([kKategorie] ASC, [kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieSprache",
|
|
"indexName": "PK_dbo_tKategorieSprache",
|
|
"ddl": "ALTER TABLE [dbo].[tKategorieSprache] ADD CONSTRAINT [PK_dbo_tKategorieSprache] PRIMARY KEY CLUSTERED ([kKategorie] ASC, [kSprache] ASC, [kPlattform] ASC, [kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieSprache",
|
|
"indexName": "IX_tKategorieSprache_kPlattform",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tKategorieSprache_kPlattform] ON [dbo].[tKategorieSprache] ([kPlattform] ASC) INCLUDE ([kKategorie], [kSprache], [cName]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"indexName": "PK_dbo_tkunde",
|
|
"ddl": "ALTER TABLE [dbo].[tkunde] ADD CONSTRAINT [PK_dbo_tkunde] PRIMARY KEY CLUSTERED ([kKunde] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"indexName": "IX_tKunde_cKundenNr",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tKunde_cKundenNr] ON [dbo].[tkunde] ([cKundenNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"indexName": "IX_tKunde_nDebitorenNummer",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tKunde_nDebitorenNummer] ON [dbo].[tkunde] ([nDebitorennr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKundenGruppe",
|
|
"indexName": "PK_dbo_tKundenGruppe",
|
|
"ddl": "ALTER TABLE [dbo].[tKundenGruppe] ADD CONSTRAINT [PK_dbo_tKundenGruppe] PRIMARY KEY CLUSTERED ([kKundenGruppe] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLaufendeNummern",
|
|
"indexName": "PK_dbo_tLaufendeNummern",
|
|
"ddl": "ALTER TABLE [dbo].[tLaufendeNummern] ADD CONSTRAINT [PK_dbo_tLaufendeNummern] PRIMARY KEY CLUSTERED ([kLaufendeNummer] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLaufendeNummern",
|
|
"indexName": "UX_dbo_tLaufendeNummern_cName_kFirma",
|
|
"ddl": "CREATE UNIQUE NONCLUSTERED INDEX [UX_dbo_tLaufendeNummern_cName_kFirma] ON [dbo].[tLaufendeNummern] ([cName] ASC, [kFirma] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"indexName": "PK_dbo_tLieferschein",
|
|
"ddl": "ALTER TABLE [dbo].[tLieferschein] ADD CONSTRAINT [PK_dbo_tLieferschein] PRIMARY KEY CLUSTERED ([kLieferschein] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"indexName": "IX_dbo_tLieferschein_cLieferscheinNr",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tLieferschein_cLieferscheinNr] ON [dbo].[tLieferschein] ([cLieferscheinNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"indexName": "IX_dbo_tLieferschein_dErstellt",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tLieferschein_dErstellt] ON [dbo].[tLieferschein] ([dErstellt] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"indexName": "IX_tLieferschein_kBestellung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tLieferschein_kBestellung] ON [dbo].[tLieferschein] ([kBestellung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"indexName": "IX_tLieferschein_kLieferantenBestellung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tLieferschein_kLieferantenBestellung] ON [dbo].[tLieferschein] ([kLieferantenBestellung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "PK_dbo_tPickliste",
|
|
"ddl": "ALTER TABLE [dbo].[tPickliste] ADD CONSTRAINT [PK_dbo_tPickliste] PRIMARY KEY CLUSTERED ([kPickliste] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "IX_dbo_tPickliste_cPicklisteNr",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPickliste_cPicklisteNr] ON [dbo].[tPickliste] ([cPicklisteNr] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "IX_dbo_tPickliste_kPicklisteStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPickliste_kPicklisteStatus] ON [dbo].[tPickliste] ([kPicklisteStatus] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "IX_dbo_tPickliste_nStatus_nType",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPickliste_nStatus_nType] ON [dbo].[tPickliste] ([nStatus] ASC, [nType] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "IX_dbo_tPickliste_nType",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPickliste_nType] ON [dbo].[tPickliste] ([nType] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"indexName": "IX_tPickliste_kWarenLager_nStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPickliste_kWarenLager_nStatus] ON [dbo].[tPickliste] ([kWarenLager] ASC, [nStatus] ASC) INCLUDE ([kPicklistenVorlage], [kPicklisteStatusAngelegt]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "PK_dbo_tPicklistePos",
|
|
"ddl": "ALTER TABLE [dbo].[tPicklistePos] ADD CONSTRAINT [PK_dbo_tPicklistePos] PRIMARY KEY CLUSTERED ([kPicklistePos] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_dbo_tPicklistePos_kArtikel_kWarenlager_INCL_F",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPicklistePos_kArtikel_kWarenlager_INCL_F] ON [dbo].[tPicklistePos] ([kArtikel] ASC, [kWarenLager] ASC) INCLUDE ([fAnzahl], [kBestellPos], [kPickliste], [nStatus]) WHERE ([nStatus]<(40)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_dbo_tPicklistePos_kLieferscheinPos_nStatus_kWarenlagerPlatz",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPicklistePos_kLieferscheinPos_nStatus_kWarenlagerPlatz] ON [dbo].[tPicklistePos] ([kLieferscheinPos] ASC, [nStatus] ASC, [kWarenlagerPlatz] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_dbo_tPicklistePos_kPickliste_nStatus_kBestellung_FilterStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPicklistePos_kPickliste_nStatus_kBestellung_FilterStatus] ON [dbo].[tPicklistePos] ([kPickliste] ASC, [nStatus] ASC) INCLUDE ([kBestellung]) WHERE ([nStatus]<(40)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_dbo_tPicklistePos_kWarenLagerEingang_nStatus_kBestellung_FilterOnnStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPicklistePos_kWarenLagerEingang_nStatus_kBestellung_FilterOnnStatus] ON [dbo].[tPicklistePos] ([kWarenLagerEingang] ASC, [nStatus] ASC, [kBestellung] ASC) INCLUDE ([fAnzahl]) WHERE ([nStatus]<(40)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_dbo_tPicklistePos_nStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tPicklistePos_nStatus] ON [dbo].[tPicklistePos] ([nStatus] ASC, [nVorreserviert] ASC) INCLUDE ([fAnzahl], [kBestellPos]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kBestellPos_INCL_F",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kBestellPos_INCL_F] ON [dbo].[tPicklistePos] ([kBestellPos] ASC) INCLUDE ([fAnzahl]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kBestellPos_kWarenlager",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kBestellPos_kWarenlager] ON [dbo].[tPicklistePos] ([kBestellPos] ASC, [kWarenLager] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kBestellung_nStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kBestellung_nStatus] ON [dbo].[tPicklistePos] ([kBestellung] ASC, [nStatus] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kPickliste",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kPickliste] ON [dbo].[tPicklistePos] ([kPickliste] ASC) INCLUDE ([kBestellPos], [fAnzahl]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kPickliste_nStatus_kBestellung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kPickliste_nStatus_kBestellung] ON [dbo].[tPicklistePos] ([kPickliste] ASC, [nStatus] ASC) INCLUDE ([kBestellung]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"indexName": "IX_tPicklistePos_kWarenLagerEingang",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPicklistePos_kWarenLagerEingang] ON [dbo].[tPicklistePos] ([kWarenLagerEingang] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tpk",
|
|
"indexName": "PK_dbo_tpk",
|
|
"ddl": "ALTER TABLE [dbo].[tpk] ADD CONSTRAINT [PK_dbo_tpk] PRIMARY KEY CLUSTERED ([cName] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPlattform",
|
|
"indexName": "PK_dbo_tPlattform",
|
|
"ddl": "ALTER TABLE [dbo].[tPlattform] ADD CONSTRAINT [PK_dbo_tPlattform] PRIMARY KEY CLUSTERED ([nPlattform] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"indexName": "PK_dbo_tPreis",
|
|
"ddl": "ALTER TABLE [dbo].[tPreis] ADD CONSTRAINT [PK_dbo_tPreis] PRIMARY KEY CLUSTERED ([kPreis] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"indexName": "UQ_dbo_tPreis_kArtikel_kKundenGruppe_kShop_kKunde",
|
|
"ddl": "ALTER TABLE [dbo].[tPreis] ADD CONSTRAINT [UQ_dbo_tPreis_kArtikel_kKundenGruppe_kShop_kKunde] UNIQUE NONCLUSTERED ([kArtikel] ASC, [kKundenGruppe] ASC, [kShop] ASC, [kKunde] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"indexName": "IX_tPreis_kArtikel_kShop",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPreis_kArtikel_kShop] ON [dbo].[tPreis] ([kArtikel] ASC, [kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"indexName": "IX_tPreis_kShop_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tPreis_kShop_INCL] ON [dbo].[tPreis] ([kShop] ASC) INCLUDE ([kPreis], [kArtikel], [kKundenGruppe], [kKunde]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreisDetail",
|
|
"indexName": "PK_dbo_tPreisDetail",
|
|
"ddl": "ALTER TABLE [dbo].[tPreisDetail] ADD CONSTRAINT [PK_dbo_tPreisDetail] PRIMARY KEY CLUSTERED ([kPreis] ASC, [nAnzahlAb] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSessionId",
|
|
"indexName": "PK_dbo_tSessionId",
|
|
"ddl": "ALTER TABLE [dbo].[tSessionId] ADD CONSTRAINT [PK_dbo_tSessionId] PRIMARY KEY CLUSTERED ([kSessionId] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tShop",
|
|
"indexName": "PK_dbo_tShop",
|
|
"ddl": "ALTER TABLE [dbo].[tShop] ADD CONSTRAINT [PK_dbo_tShop] PRIMARY KEY CLUSTERED ([kShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tShopSubshop",
|
|
"indexName": "PK_dbo_tShopSubshop",
|
|
"ddl": "ALTER TABLE [dbo].[tShopSubshop] ADD CONSTRAINT [PK_dbo_tShopSubshop] PRIMARY KEY CLUSTERED ([kShopSubshop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuersatz",
|
|
"indexName": "PK_dbo_tSteuersatz",
|
|
"ddl": "ALTER TABLE [dbo].[tSteuersatz] ADD CONSTRAINT [PK_dbo_tSteuersatz] PRIMARY KEY CLUSTERED ([kSteuersatz] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuersatz",
|
|
"indexName": "UQ_dbo_tSteuersatz_kSteuerklasse_kSteuerzone",
|
|
"ddl": "ALTER TABLE [dbo].[tSteuersatz] ADD CONSTRAINT [UQ_dbo_tSteuersatz_kSteuerklasse_kSteuerzone] UNIQUE NONCLUSTERED ([kSteuerklasse] ASC, [kSteuerzone] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuersatz",
|
|
"indexName": "IX_dbo_tSteuersatz_kSteuerzone_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tSteuersatz_kSteuerzone_INCL] ON [dbo].[tSteuersatz] ([kSteuerzone] ASC) INCLUDE ([kSteuerklasse], [fSteuersatz]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuerzone",
|
|
"indexName": "PK_dbo_tSteuerzone",
|
|
"ddl": "ALTER TABLE [dbo].[tSteuerzone] ADD CONSTRAINT [PK_dbo_tSteuerzone] PRIMARY KEY CLUSTERED ([kSteuerzone] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"indexName": "PK_dbo_tStueckliste",
|
|
"ddl": "ALTER TABLE [dbo].[tStueckliste] ADD CONSTRAINT [PK_dbo_tStueckliste] PRIMARY KEY CLUSTERED ([kStueckliste] ASC, [kArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"indexName": "UQ_dbo_tStueckliste_kArtikel_kStueckliste_nSort",
|
|
"ddl": "ALTER TABLE [dbo].[tStueckliste] ADD CONSTRAINT [UQ_dbo_tStueckliste_kArtikel_kStueckliste_nSort] UNIQUE NONCLUSTERED ([kArtikel] ASC, [kStueckliste] ASC, [nSort] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"indexName": "IX_dbo_tStueckliste_kVaterArtikel",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tStueckliste_kVaterArtikel] ON [dbo].[tStueckliste] ([kVaterArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"indexName": "IX_tStueckliste_kArtikel",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tStueckliste_kArtikel] ON [dbo].[tStueckliste] ([kArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"indexName": "IX_tStueckliste_kStueckliste",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tStueckliste_kStueckliste] ON [dbo].[tStueckliste] ([kStueckliste] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"indexName": "PK_dbo_tVersand",
|
|
"ddl": "ALTER TABLE [dbo].[tVersand] ADD CONSTRAINT [PK_dbo_tVersand] PRIMARY KEY CLUSTERED ([kVersand] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"indexName": "IX_tVersand_dVersendet",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tVersand_dVersendet] ON [dbo].[tVersand] ([dVersendet] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"indexName": "IX_tVersand_kLieferschein",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tVersand_kLieferschein] ON [dbo].[tVersand] ([kLieferschein] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"indexName": "IX_Versand_cIdentCode",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Versand_cIdentCode] ON [dbo].[tVersand] ([cIdentCode] ASC) INCLUDE ([kLieferschein]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tversandart",
|
|
"indexName": "PK_dbo_tversandart",
|
|
"ddl": "ALTER TABLE [dbo].[tversandart] ADD CONSTRAINT [PK_dbo_tversandart] PRIMARY KEY CLUSTERED ([kVersandArt] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLager",
|
|
"indexName": "PK_dbo_tWarenLager",
|
|
"ddl": "ALTER TABLE [dbo].[tWarenLager] ADD CONSTRAINT [PK_dbo_tWarenLager] PRIMARY KEY CLUSTERED ([kWarenLager] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "PK_dbo_tWarenLagerPlatz",
|
|
"ddl": "ALTER TABLE [dbo].[tWarenLagerPlatz] ADD CONSTRAINT [PK_dbo_tWarenLagerPlatz] PRIMARY KEY CLUSTERED ([kWarenLagerPlatz] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "UQ_dbo_tWarenLagerPlatz_cName_kWarenLager",
|
|
"ddl": "ALTER TABLE [dbo].[tWarenLagerPlatz] ADD CONSTRAINT [UQ_dbo_tWarenLagerPlatz_cName_kWarenLager] UNIQUE NONCLUSTERED ([cName] ASC, [kWarenLager] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "IX_tWarenLagerPlatz_kWarenLager_nStatus",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tWarenLagerPlatz_kWarenLager_nStatus] ON [dbo].[tWarenLagerPlatz] ([kWarenLager] ASC, [nStatus] ASC) INCLUDE ([kWarenLagerPlatz], [nSort], [cName], [kWarenLagerPlatzTyp]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "IX_tWarenLagerPlatz_kWarenLagerPlatzTyp_kWarenLager",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tWarenLagerPlatz_kWarenLagerPlatzTyp_kWarenLager] ON [dbo].[tWarenLagerPlatz] ([kWarenLagerPlatzTyp] ASC, [kWarenLager] ASC) INCLUDE ([kWarenLagerPlatz], [nSort], [cName], [nStatus], [nGesperrt]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "IX_tWarenLagerPlatz_nPrio_nSort_kWarenlager",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tWarenLagerPlatz_nPrio_nSort_kWarenlager] ON [dbo].[tWarenLagerPlatz] ([nPrio] ASC, [nSort] ASC, [kWarenLager] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"indexName": "IX_tWarenLagerPlatz_nStatus_kWarenLagerPlatzTyp_cName",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tWarenLagerPlatz_nStatus_kWarenLagerPlatzTyp_cName] ON [dbo].[tWarenLagerPlatz] ([nStatus] ASC, [kWarenLagerPlatzTyp] ASC, [cName] ASC) INCLUDE ([kWarenLager], [kWarenLagerPlatz], [fGewichtMax], [fLaenge], [fBreite], [fHoehe], [nSort], [nGesperrt], [kWmsInventur], [dWmsInventurDatum], [nPreInvStatus]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "PK_dbo_tZahlung",
|
|
"ddl": "ALTER TABLE [dbo].[tZahlung] ADD CONSTRAINT [PK_dbo_tZahlung] PRIMARY KEY CLUSTERED ([kZahlung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_dbo_tZahlung_kEingangsrechnung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tZahlung_kEingangsrechnung] ON [dbo].[tZahlung] ([kEingangsrechnung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_dbo_tZahlung_kGutschrift",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_dbo_tZahlung_kGutschrift] ON [dbo].[tZahlung] ([kGutschrift] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_tZahlung_cName",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlung_cName] ON [dbo].[tZahlung] ([cName] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_tZahlung_dDatum",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlung_dDatum] ON [dbo].[tZahlung] ([dDatum] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_tZahlung_kBestellung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlung_kBestellung] ON [dbo].[tZahlung] ([kBestellung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_tZahlung_kRechnung",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlung_kRechnung] ON [dbo].[tZahlung] ([kRechnung] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"indexName": "IX_tZahlung_nZahlungstyp_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlung_nZahlungstyp_INCL] ON [dbo].[tZahlung] ([nZahlungstyp] ASC) INCLUDE ([fBetrag], [kZahlungsabgleichUmsatz]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsart",
|
|
"indexName": "PK_dbo_tZahlungsart",
|
|
"ddl": "ALTER TABLE [dbo].[tZahlungsart] ADD CONSTRAINT [PK_dbo_tZahlungsart] PRIMARY KEY CLUSTERED ([kZahlungsart] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsart",
|
|
"indexName": "IX_tZahlungsart_cName",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlungsart_cName] ON [dbo].[tZahlungsart] ([cName] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsArtSprache",
|
|
"indexName": "PK_dbo_tZahlungsArtSprache",
|
|
"ddl": "ALTER TABLE [dbo].[tZahlungsArtSprache] ADD CONSTRAINT [PK_dbo_tZahlungsArtSprache] PRIMARY KEY CLUSTERED ([kZahlungsart] ASC, [kSprache] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsArtSprache",
|
|
"indexName": "IX_tZahlungsArtSprache_cName",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlungsArtSprache_cName] ON [dbo].[tZahlungsArtSprache] ([cName] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsArtSprache",
|
|
"indexName": "IX_tZahlungsArtSprache_kZahlungsart",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_tZahlungsArtSprache_kZahlungsart] ON [dbo].[tZahlungsArtSprache] ([kZahlungsart] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Pos",
|
|
"tableName": "tAuftragPositionMapping",
|
|
"indexName": "PK_Pos_tAuftragPositionMapping",
|
|
"ddl": "ALTER TABLE [Pos].[tAuftragPositionMapping] ADD CONSTRAINT [PK_Pos_tAuftragPositionMapping] PRIMARY KEY CLUSTERED ([kAuftragPosition] ASC, [kPosAuftragPosition] ASC, [kShopSubShop] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "PK_Verkauf_tAuftrag",
|
|
"ddl": "ALTER TABLE [Verkauf].[tAuftrag] ADD CONSTRAINT [PK_Verkauf_tAuftrag] PRIMARY KEY CLUSTERED ([kAuftrag] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "UQ_Verkauf_tAuftrag_cAuftragsNr_nType",
|
|
"ddl": "ALTER TABLE [Verkauf].[tAuftrag] ADD CONSTRAINT [UQ_Verkauf_tAuftrag_cAuftragsNr_nType] UNIQUE NONCLUSTERED ([cAuftragsNr] ASC, [nType] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_cExterneAuftragsnummer",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_cExterneAuftragsnummer] ON [Verkauf].[tAuftrag] ([cExterneAuftragsnummer] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kAuftrag_F",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kAuftrag_F] ON [Verkauf].[tAuftrag] ([kAuftrag] ASC) WHERE ([nKomplettAusgeliefert]=(0) AND [nType]=(1) AND [nPending]=(0)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kAuftragQuelle_nAuftragQuelleAktion",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kAuftragQuelle_nAuftragQuelleAktion] ON [Verkauf].[tAuftrag] ([kAuftragQuelle] ASC, [nAuftragQuelleAktion] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kFarbe",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kFarbe] ON [Verkauf].[tAuftrag] ([kFarbe] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kFirmaHistory",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kFirmaHistory] ON [Verkauf].[tAuftrag] ([kFirmaHistory] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kKunde",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kKunde] ON [Verkauf].[tAuftrag] ([kKunde] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kPlattform",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kPlattform] ON [Verkauf].[tAuftrag] ([kPlattform] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_kSprache",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_kSprache] ON [Verkauf].[tAuftrag] ([kSprache] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_nAuftragStatus_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_nAuftragStatus_INCL] ON [Verkauf].[tAuftrag] ([nAuftragStatus] ASC) INCLUDE ([dAuslieferdatum]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_nIstExterneRechnung_dErstellt",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_nIstExterneRechnung_dErstellt] ON [Verkauf].[tAuftrag] ([nIstExterneRechnung] ASC, [dErstellt] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_nKomplettAusgeliefert_nType_nStorno",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_nKomplettAusgeliefert_nType_nStorno] ON [Verkauf].[tAuftrag] ([nKomplettAusgeliefert] ASC, [nType] ASC, [nStorno] ASC) INCLUDE ([kKunde], [kVersandArt], [kRueckhaltegrund], [kZahlungsart]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"indexName": "IX_Verkauf_tAuftrag_nType_dErstellt",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftrag_nType_dErstellt] ON [Verkauf].[tAuftrag] ([nType] ASC, [dErstellt] DESC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"indexName": "PK_Verkauf_tAuftragAdresse",
|
|
"ddl": "ALTER TABLE [Verkauf].[tAuftragAdresse] ADD CONSTRAINT [PK_Verkauf_tAuftragAdresse] PRIMARY KEY CLUSTERED ([kAuftrag] ASC, [nTyp] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"indexName": "IX_Verkauf_tAuftragAdresse_kAuftrag",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragAdresse_kAuftrag] ON [Verkauf].[tAuftragAdresse] ([kAuftrag] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"indexName": "IX_Verkauf_tAuftragAdresse_kKunde",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragAdresse_kKunde] ON [Verkauf].[tAuftragAdresse] ([kKunde] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragEckdaten",
|
|
"indexName": "PK_Verkauf_tAuftragEckdaten",
|
|
"ddl": "ALTER TABLE [Verkauf].[tAuftragEckdaten] ADD CONSTRAINT [PK_Verkauf_tAuftragEckdaten] PRIMARY KEY CLUSTERED ([kAuftrag] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "PK_Verkauf_tAuftragPosition",
|
|
"ddl": "ALTER TABLE [Verkauf].[tAuftragPosition] ADD CONSTRAINT [PK_Verkauf_tAuftragPosition] PRIMARY KEY CLUSTERED ([kAuftragPosition] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kAmazonBestellungPos_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kAmazonBestellungPos_INCL] ON [Verkauf].[tAuftragPosition] ([kAmazonBestellungPos] ASC) INCLUDE ([kAuftrag], [kAuftragPosition]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kArtikel_kAuftrag",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kArtikel_kAuftrag] ON [Verkauf].[tAuftragPosition] ([kArtikel] ASC, [kAuftrag] ASC) INCLUDE ([fAnzahl]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kArtikel_nReserviert",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kArtikel_nReserviert] ON [Verkauf].[tAuftragPosition] ([kArtikel] ASC, [nReserviert] ASC) WHERE ([nReserviert]=(1)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kAuftrag",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kAuftrag] ON [Verkauf].[tAuftragPosition] ([kAuftrag] ASC) INCLUDE ([kArtikel]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kAuftrag_kAuftragPosition_kArtikel_INCL",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kAuftrag_kAuftragPosition_kArtikel_INCL] ON [Verkauf].[tAuftragPosition] ([kAuftrag] ASC, [kAuftragPosition] ASC, [kArtikel] ASC) INCLUDE ([fAnzahl], [fWertNettoGesamtFixiert], [fWertBruttoGesamtFixiert], [nType]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kAuftrag_kKonfigVater_FILTER",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kAuftrag_kKonfigVater_FILTER] ON [Verkauf].[tAuftragPosition] ([kAuftrag] ASC, [kKonfigVater] ASC) WHERE ([kKonfigVater]<>(0)) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kAuftragStueckliste_kArtikel",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kAuftragStueckliste_kArtikel] ON [Verkauf].[tAuftragPosition] ([kAuftragStueckliste] ASC, [kArtikel] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kKonfigItem",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kKonfigItem] ON [Verkauf].[tAuftragPosition] ([kKonfigItem] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kKonfigVater",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kKonfigVater] ON [Verkauf].[tAuftragPosition] ([kKonfigVater] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_kSteuerklasse",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_kSteuerklasse] ON [Verkauf].[tAuftragPosition] ([kSteuerklasse] ASC) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"indexName": "IX_Verkauf_tAuftragPosition_nType",
|
|
"ddl": "CREATE NONCLUSTERED INDEX [IX_Verkauf_tAuftragPosition_nType] ON [Verkauf].[tAuftragPosition] ([nType] ASC) INCLUDE ([kAuftrag], [fAnzahl], [cArtNr], [cName]) WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)"
|
|
}
|
|
],
|
|
"triggers": [
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"triggerName": "jtlActionValidator_tartikel",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tartikel] \r\nON [dbo].[tArtikel]\r\nAFTER DELETE \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN TRY \r\n IF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n IF NOT EXISTS(SELECT 1 FROM DELETED) RETURN;\r\n\r\n\t--\r\n\t-- tWarenLagerPlatzArtikel aufräumen\r\n\t--\r\n\tDELETE dbo.tWarenLagerPlatzArtikel\r\n\tFROM dbo.tWarenLagerPlatzArtikel\r\n\tJOIN DELETED ON DELETED.kArtikel = dbo.tWarenLagerPlatzArtikel.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelBeschreibung aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelBeschreibung\r\n\tFROM dbo.tArtikelBeschreibung\r\n\tJOIN DELETED ON DELETED.kArtikel = dbo.tArtikelBeschreibung.kArtikel;\r\n\r\n\t--\r\n\t-- nIstVater auf 0 setzen wenn alle Kinder gelöscht wurden\r\n\t--\r\n\tUPDATE dbo.tArtikel\r\n\tSET dbo.tArtikel.nIstVater = 0 \r\n\tWHERE dbo.tArtikel.kArtikel IN\r\n\t(\r\n\t\tSELECT dbo.tArtikel.kArtikel\r\n\t\tFROM dbo.tArtikel\r\n\t\tJOIN DELETED ON dbo.tArtikel.kArtikel = DELETED.kVaterartikel\r\n\t\tLEFT JOIN dbo.tArtikel AS Kinder ON dbo.tArtikel.kArtikel = Kinder.kVaterArtikel\r\n\t\tWHERE dbo.tArtikel.nIstVater > 0 \r\n\t\t\tAND Kinder.kArtikel IS NULL \r\n\t\tGROUP BY dbo.tArtikel.kArtikel\r\n\t);\r\n\r\n\t--\r\n\t-- tArtikelSpeicher aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelSpeicher\r\n\tFROM dbo.tArtikelSpeicher\r\n\tJOIN DELETED ON DELETED.kArtikel = dbo.tArtikelSpeicher.kArtikel;\r\n\t\t\r\n\t--\r\n\t-- tArtikelAttribute aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelAttribut\r\n\tFROM dbo.tArtikelAttribut\r\n\tJOIN DELETED ON dbo.tArtikelAttribut.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelbildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelbildPlattform\r\n\tFROM dbo.tArtikelbildPlattform\r\n\tJOIN DELETED ON dbo.tArtikelbildPlattform.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tartikeldownload aufräumen\r\n\t--\r\n\tDELETE dbo.tartikeldownload\r\n\tFROM dbo.tartikeldownload\r\n\tJOIN DELETED ON dbo.tartikeldownload.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelEinkaufsliste aufräumen\r\n\t--\r\n\tDELETE tArtikelEinkaufsliste\r\n\tFROM tArtikelEinkaufsliste\r\n\tJOIN DELETED ON tArtikelEinkaufsliste.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelHistory aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelHistory\r\n\tFROM dbo.tArtikelHistory\r\n\tJOIN DELETED ON dbo.tArtikelHistory.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tartikelkonfiggruppe aufräumen\r\n\t--\r\n\tDELETE dbo.tartikelkonfiggruppe\r\n\tFROM dbo.tartikelkonfiggruppe\r\n\tJOIN DELETED ON dbo.tartikelkonfiggruppe.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelLagerOrt aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelLagerOrt\r\n\tFROM dbo.tArtikelLagerOrt\r\n\tJOIN DELETED ON dbo.tArtikelLagerOrt.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelMerkmal aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelMerkmal\r\n\tFROM dbo.tArtikelMerkmal\r\n\tJOIN DELETED ON dbo.tArtikelMerkmal.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelRankingGlobal aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelRankingGlobal\r\n\tFROM dbo.tArtikelRankingGlobal\r\n\tJOIN DELETED ON dbo.tArtikelRankingGlobal.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelRankingZeitraum aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelRankingZeitraum\r\n\tFROM dbo.tArtikelRankingZeitraum\r\n\tJOIN DELETED ON dbo.tArtikelRankingZeitraum.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelSichtbarkeit\r\n\tFROM dbo.tArtikelSichtbarkeit\r\n\tJOIN DELETED ON dbo.tArtikelSichtbarkeit.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelSonderpreis aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelSonderpreis\r\n\tFROM dbo.tArtikelSonderpreis\r\n\tJOIN DELETED ON dbo.tArtikelSonderpreis.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelSperre aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelSperre\r\n\tFROM dbo.tArtikelSperre\r\n\tJOIN DELETED ON dbo.tArtikelSperre.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tArtikelUpload aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelUpload\r\n\tFROM dbo.tArtikelUpload\r\n\tJOIN DELETED ON dbo.tArtikelUpload.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tattribut aufräumen\r\n\t--\r\n\tDELETE dbo.tartikelattribut\r\n\tFROM dbo.tartikelattribut\r\n\tJOIN DELETED ON dbo.tartikelattribut.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- [Verkauf]-Schema aufräumen\r\n\t--\r\n\tUPDATE Verkauf.tAuftragPosition\r\n\tSET tAuftragPosition.kArtikel = NULL,\r\n\t\tnType = 0\r\n\tWHERE tAuftragPosition.kArtikel IN (SELECT Deleted.kArtikel FROM Deleted);\r\n\t\t\r\n\tUPDATE dbo.tRMRetourePos \r\n\tSET kArtikel = 0\r\n\tWHERE dbo.tRMRetourePos.kArtikel IN (SELECT DELETED.kArtikel FROM DELETED);\t\r\n\r\n\tDELETE dbo.tArtikelZustand\r\n\tWHERE dbo.tArtikelZustand.kHauptartikel IN (SELECT DELETED.kArtikel FROM DELETED);\r\n\t\r\n\tDELETE dbo.tArtikelZustand\r\n\tWHERE dbo.tArtikelZustand.kZustandArtikel IN (SELECT DELETED.kArtikel FROM DELETED);\r\n\r\n --\r\n\t-- teigenschaft aufräumen\r\n\t--\r\n\tDELETE dbo.teigenschaft\r\n\tFROM dbo.teigenschaft\r\n\tJOIN DELETED ON dbo.teigenschaft.kArtikel = DELETED.kArtikel;\r\n\r\n --\r\n\t-- pf_amazon_angebot_mapping aufräumen\r\n\t--\r\n\tDELETE dbo.pf_amazon_angebot_mapping\r\n\tFROM dbo.pf_amazon_angebot_mapping\r\n\tJOIN DELETED ON dbo.pf_amazon_angebot_mapping.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tEingangsrechnungPos aufräumen\r\n\t--\r\n\tUPDATE dbo.tEingangsrechnungPos\r\n\tSET dbo.tEingangsrechnungPos.kArtikel = 0,\r\n\t\tdbo.tEingangsrechnungPos.nPosTyp = 0 \r\n\tFROM dbo.tEingangsrechnungPos\r\n\tJOIN DELETED ON dbo.tEingangsrechnungPos.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tGebinde aufräumen\r\n\t--\r\n\tDELETE dbo.tGebinde\r\n\tFROM dbo.tGebinde\r\n\tJOIN DELETED ON dbo.tGebinde.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tgutschrifteigenschaft aufräumen\r\n\t--\r\n\tUPDATE dbo.tgutschrifteigenschaft\r\n\tSET dbo.tgutschrifteigenschaft.kArtikel = 0\r\n\tFROM dbo.tgutschrifteigenschaft\r\n\tJOIN DELETED ON dbo.tgutschrifteigenschaft.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tgutschriftpos aufräumen\r\n\t--\r\n\tDECLARE @xGutschriftpos AS XML;\r\n\tSET @xGutschriftpos = (\r\n\t\tSELECT tgutschriftpos.kGutschriftPos, 0 AS kArtikel, tgutschriftpos.tGutschrift_kGutschrift AS kGutschrift, \r\n\t\t\t\ttgutschriftpos.fVKPreis, tgutschriftpos.fMwSt, tgutschriftpos.nAnzahl, tgutschriftpos.fRabatt, \r\n\t\t\t\ttgutschriftpos.cString, tgutschriftpos.fVKNetto, tgutschriftpos.cArtNr, tgutschriftpos.nLager, \r\n\t\t\t\ttgutschriftpos.kBestellPos, tgutschriftpos.kGutschriftStueckliste, tgutschriftpos.kRechnungPosition,\r\n\t\t\t\ttgutschriftpos.nAuftragsmengeReduzieren, tgutschriftpos.nLiefermengeReduzieren\r\n\t\t\tFROM dbo.tgutschriftpos\r\n\t\t\tJOIN DELETED ON tgutschriftpos.tArtikel_kArtikel = DELETED.kArtikel\r\n\t\t\tFOR XML PATH('Gutschriftpos'), TYPE\r\n\t\t);\r\n\tEXEC Gutschrift.spGutschriftposAendern @xGutschriftPos = @xGutschriftpos;\r\n\r\n\t--\r\n\t-- tInventur aufräumen\r\n\t--\r\n\tDELETE dbo.tInventur\r\n\tFROM dbo.tInventur\r\n\tJOIN DELETED ON dbo.tInventur.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tkategorieartikel aufräumen\r\n\t--\r\n\tDELETE dbo.tkategorieartikel\r\n\tFROM dbo.tkategorieartikel\r\n\tJOIN DELETED ON dbo.tkategorieartikel.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tkonfigitem aufräumen\r\n\t--\r\n\tDELETE dbo.tkonfigitem\r\n\tFROM dbo.tkonfigitem\r\n\tJOIN DELETED ON dbo.tkonfigitem.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tlagerartikel aufräumen\r\n\t--\r\n\t-- Damit das Verfolgen von Seriennummern bei geloeschten Artikeln funktioniert wird dieses DELETE-Statement ausser Kraft gesetzt.\r\n\t--DELETE dbo.tlagerartikel\r\n\t--FROM dbo.tlagerartikel\r\n\t--JOIN DELETED ON dbo.tlagerartikel.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tLieferantenBestellungPos aufräumen\r\n\t--\r\n\tDECLARE @xLieferantenBestellungPos AS XML;\r\n\tSET @xLieferantenBestellungPos = (\r\n\t\tSELECT dbo.tLieferantenBestellungPos.kLieferantenBestellungPos AS kLieferantenbestellungPos, dbo.tLieferantenBestellungPos.kLieferantenBestellung AS kLieferantenbestellung, \r\n\t\t\t\t0 AS kArtikel, dbo.tLieferantenBestellungPos.cArtNr, dbo.tLieferantenBestellungPos.cLieferantenArtNr, \r\n\t\t\t\tdbo.tLieferantenBestellungPos.cName, dbo.tLieferantenBestellungPos.cLieferantenBezeichnung,\r\n\t\t\t\tdbo.tLieferantenBestellungPos.fUST, dbo.tLieferantenBestellungPos.fMenge, dbo.tLieferantenBestellungPos.cHinweis, \r\n\t\t\t\tdbo.tLieferantenBestellungPos.fEKNetto, dbo.tLieferantenBestellungPos.nPosTyp, dbo.tLieferantenBestellungPos.cNameLieferant, \r\n\t\t\t\tdbo.tLieferantenBestellungPos.nLiefertage, dbo.tLieferantenBestellungPos.dLieferdatum, dbo.tLieferantenBestellungPos.nSort,\r\n\t\t\t\tdbo.tLieferantenBestellungPos.kLieferscheinPos, dbo.tLieferantenBestellungPos.fMengeGeliefert, \r\n\t\t\t\tdbo.tLieferantenBestellungPos.cVPEEinheit, dbo.tLieferantenBestellungPos.nVPEMenge\r\n\t\t\tFROM dbo.tLieferantenBestellungPos\r\n\t\t\tJOIN DELETED ON dbo.tLieferantenBestellungPos.kArtikel = DELETED.kArtikel\r\n\t\t\tFOR XML PATH('LieferantenbestellungPos'), TYPE\r\n\t);\r\n\tEXEC Lieferantenbestellung.spLieferantenBestellungPosBearbeiten @xLieferantenbestellungPos = @xLieferantenBestellungPos;\r\n\r\n\t--\r\n\t-- tMedienDatei aufräumen\r\n\t--\r\n\tDELETE dbo.tMedienDatei\r\n\tFROM dbo.tMedienDatei\r\n\tJOIN DELETED ON dbo.tMedienDatei.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tPicklistePos aufräumen\r\n\t--\r\n\tDELETE dbo.tPicklistePos\r\n\tFROM dbo.tPicklistePos\r\n\tJOIN DELETED ON dbo.tPicklistePos.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tPreis aufräumen\r\n\t--\r\n\tDELETE dbo.tPreis\r\n\tFROM dbo.tPreis\r\n\tJOIN DELETED ON dbo.tPreis.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tStueckliste aufräumen (Komponenten)\r\n\t--\r\n\tDELETE dbo.tStueckliste\r\n\tFROM dbo.tStueckliste\r\n\tJOIN DELETED ON dbo.tStueckliste.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tStueckliste aufräumen (Stücklisten selbst)\r\n\t--\r\n\tDELETE dbo.tStueckliste\r\n\tFROM dbo.tStueckliste\r\n\tJOIN DELETED ON dbo.tStueckliste.kStueckliste = DELETED.kStueckliste;\r\n\r\n\t--\r\n\t-- tWarenlagerArtikelOptionen aufräumen\r\n\t--\r\n\tDELETE dbo.tWarenlagerArtikelOptionen\r\n\tFROM dbo.tWarenlagerArtikelOptionen\r\n\tJOIN DELETED ON dbo.tWarenlagerArtikelOptionen.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tWarenLagerAusgang aufräumen\r\n\t--\r\n\tSET CONTEXT_INFO 0x6001;\r\n\r\n\tDELETE dbo.tWarenLagerAusgang\r\n\tFROM dbo.tWarenLagerAusgang\r\n\tJOIN DELETED ON dbo.tWarenLagerAusgang.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tWarenLagerEingang aufräumen\r\n\t--\r\n DELETE dbo.tWarenLagerEingang\r\n\tFROM dbo.tWarenLagerEingang\r\n\tJOIN DELETED ON dbo.tWarenLagerEingang.kArtikel = DELETED.kArtikel;\r\n\r\n\tSET CONTEXT_INFO 0x000;\r\n\r\n\t--\r\n\t-- tXSell aufräumen\r\n\t--\r\n\tDELETE dbo.tXSell\r\n\tFROM dbo.tXSell\r\n\tJOIN DELETED ON dbo.tXSell.kArtikel = DELETED.kArtikel;\r\n\t\r\n\tDELETE dbo.tXSell\r\n\tFROM dbo.tXSell\r\n\tJOIN DELETED ON dbo.tXSell.kXSellArtikel = DELETED.kArtikel;\r\n\r\n\tUPDATE dbo.tArtikel\r\n\tSET dbo.tArtikel.nIstVater = 0\r\n\tFROM dbo.tArtikel\r\n\tJOIN DELETED ON dbo.tArtikel.kArtikel = DELETED.kVaterArtikel\r\n\tLEFT JOIN dbo.tArtikel AS KindArtikel ON dbo.tArtikel.kArtikel = KindArtikel.kVaterArtikel\r\n\tWHERE dbo.tArtikel.kArtikel = DELETED.kVaterArtikel\r\n\t\tAND KindArtikel.kArtikel IS NULL;\r\n\r\n\t--\r\n\t-- Shopzuordnungen der Kinder löschen (das muss sein, da der Trigger sich selbst nicht nochmal aufruft)\r\n\t--\r\n\tDELETE dbo.tArtikelShop\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN dbo.tArtikel AS Kinder ON dbo.tArtikelShop.kArtikel = Kinder.kArtikel\r\n\t\t\t\t\t\t\tAND Kinder.kEigenschaftKombi > 0\r\n\tJOIN DELETED AS Vater ON Kinder.kVaterArtikel = Vater.kArtikel\r\n\t\t\t\t\t\t\tAND Vater.nIstVater = 1\r\n\r\n\t--\r\n\t-- Varkombi Kinder löschen\r\n\t-- \r\n\tDELETE dbo.tArtikel\r\n\tFROM dbo.tArtikel \r\n\tJOIN DELETED ON dbo.tArtikel.kVaterArtikel = DELETED.kArtikel;\r\n\r\n\tIF EXISTS (SELECT * FROM DELETED WHERE DELETED.kEigenschaftKombi > 0)\r\n\tBEGIN\r\n\r\n\t --\r\n\t -- Varkombi Kinder löschen\r\n\t -- \r\n\t DELETE dbo.tEigenschaftKombiWert\r\n\t FROM dbo.tEigenschaftKombiWert\r\n\t JOIN DELETED ON dbo.tEigenschaftKombiWert.kEigenschaftKombi = DELETED.kEigenschaftKombi;\r\n\r\n\tEND;\r\n\r\n\t--\r\n\t-- eBay-Angebotsvorlagen löschen\r\n\t--\r\n\tDELETE dbo.ebay_item\r\n\tFROM dbo.ebay_item\r\n\tJOIN DELETED ON dbo.ebay_item.kArtikel = DELETED.kArtikel \r\n\t\t\t\tAND dbo.ebay_item.Type = 'V'\r\n\t\t\t\tAND dbo.ebay_item.Status < 3\r\n\t\t\t\tAND dbo.ebay_item.Sent = 'N'\r\n\t\t\t\tAND dbo.ebay_item.kPlanung = 0;\r\n\r\n\tDELETE dbo.tQueue\r\n\tFROM dbo.tQueue\r\n\tJOIN\r\n\t(\r\n\t\tSELECT DELETED.kHersteller, dbo.tArtikelShop.kShop\r\n\t\tFROM DELETED\r\n\t\tJOIN dbo.tArtikelShop ON DELETED.kArtikel = dbo.tArtikelShop.kArtikel\r\n\t\tJOIN dbo.tShopKonfiguration ON dbo.tArtikelShop.kShop = dbo.tShopKonfiguration.kShop\r\n\t\t\t\t\t\t\t\tAND dbo.tShopKonfiguration.nHerstellerGefiltertSenden = 1\r\n\t\tLEFT JOIN (\r\n\t\t\tSELECT dbo.tHersteller.kHersteller, dbo.tArtikelShop.kShop, COUNT(1) AS Anzahl\r\n\t\t\t\tFROM tArtikel\r\n\t\t\t\tJOIN dbo.tHersteller ON dbo.tArtikel.kHersteller = dbo.tHersteller.kHersteller\r\n\t\t\t\tJOIN dbo.tArtikelShop ON dbo.tArtikel.kArtikel = dbo.tArtikelShop.kArtikel\r\n\t\t\t\tGROUP BY dbo.tArtikel.kArtikel, dbo.tHersteller.kHersteller, dbo.tArtikelShop.kShop\r\n\t\t) AS Result ON Result.kHersteller = DELETED.kHersteller\r\n\t\t\t\t\tAND dbo.tArtikelShop.kShop = Result.kShop\r\n\t\tWHERE ISNULL(Anzahl, 0) = 0\r\n\t) AS Items ON dbo.tQueue.kWert = Items.kHersteller\r\n\t\t\tAND dbo.tQueue.cName = 'tHersteller'\r\n\t\t\tAND dbo.tQueue.kShop = Items.kShop\r\n\t\t\tAND dbo.tQueue.nAction = 1\r\n\r\n\tINSERT INTO dbo.tQueue(kWert, kShop, cName, kPlattform, nAction)\r\n\tSELECT DELETED.kHersteller, dbo.tArtikelShop.kShop, 'tHersteller', 2, 2\r\n\tFROM DELETED\r\n\tJOIN dbo.tArtikelShop ON DELETED.kArtikel = dbo.tArtikelShop.kArtikel\r\n\tJOIN dbo.tShopKonfiguration ON dbo.tArtikelShop.kShop = dbo.tShopKonfiguration.kShop\r\n\t\t\t\t\t\t\tAND dbo.tShopKonfiguration.nHerstellerGefiltertSenden = 1\r\n\tLEFT JOIN (\r\n\t\tSELECT dbo.tHersteller.kHersteller, dbo.tArtikelShop.kShop, COUNT(1) AS Anzahl\r\n\t\t\tFROM tArtikel\r\n\t\t\tJOIN dbo.tHersteller ON dbo.tArtikel.kHersteller = dbo.tHersteller.kHersteller\r\n\t\t\tJOIN dbo.tArtikelShop ON dbo.tArtikel.kArtikel = dbo.tArtikelShop.kArtikel\r\n\t\t\tGROUP BY dbo.tArtikel.kArtikel, dbo.tHersteller.kHersteller, dbo.tArtikelShop.kShop\r\n\t) AS Result ON Result.kHersteller = DELETED.kHersteller\r\n\t\t\t\tAND dbo.tArtikelShop.kShop = Result.kShop\r\n\tWHERE DELETED.kHersteller > 0 AND ISNULL(Anzahl, 0) = 0\r\n\tGROUP BY DELETED.kHersteller, dbo.tArtikelShop.kShop\r\n\r\n\t--\r\n\t-- tArtikelShop aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelShop\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN DELETED ON dbo.tArtikelShop.kArtikel = DELETED.kArtikel;\r\n\r\n\t--\r\n\t-- tlagerbestand aufräumen\r\n\t--\r\n\tDELETE dbo.tlagerbestand\r\n\tFROM dbo.tlagerbestand\r\n\tJOIN DELETED ON DELETED.kArtikel = dbo.tlagerbestand.kArtikel;\r\n\r\n\t-- Vaterartikel , Stücklisten Väter und Alle die gelöscht wurden aktualisieren\r\n\tDECLARE @typeArtikel AS TYPE_spUpdateLagerbestand;\r\n\r\n\tINSERT INTO @typeArtikel (kArtikel)\r\n\tSELECT DISTINCT t1.kArtikel \r\n\tFROM\r\n\t\t\t( SELECT kVaterArtikel AS kArtikel\r\n\t\t\t FROM DELETED \r\n\t\t\t UNION \r\n\t\t\t SELECT tArtikel.kArtikel AS kArtikel\r\n\t\t\t FROM tStueckliste\r\n\t\t\t JOIN tArtikel ON tArtikel.kStueckliste = tStueckliste.kStueckliste\r\n\t\t\t WHERE tStueckliste.kArtikel in (SELECT DELETED.kArtikel FROM DELETED)) AS t1\r\n\t\t\t\t\t\t\t\t\t\r\n\tEXEC spUpdateLagerbestand @typeArtikel;\r\n\r\n\r\n\t--\r\n\t-- Connector - Falls Varkombi-Kind gelöscht wurde, müssen die verbliebenen Kinder nochmals zum Shop gesendet werden\r\n\t--\r\n\tIF(\r\n\t\tEXISTS(\r\n\t\tSELECT *\r\n\t\tFROM DELETED\r\n\t\tWHERE DELETED.kEigenschaftKombi > 0)\r\n\t\t)\r\n\tBEGIN\r\n\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET dbo.tArtikelShop.cInet = 'Y',\r\n\t\t\t\tdbo.tArtikelShop.nAktion = tArtikelShop.nAktion | 1\r\n\t\tFROM DELETED AS DeletedKind\r\n\t\tJOIN dbo.tArtikel AS RestlicheKinder ON DeletedKind.kVaterArtikel = RestlicheKinder.kVaterArtikel\r\n\t\tJOIN dbo.tArtikelShop ON RestlicheKinder.kArtikel = dbo.tArtikelShop.kArtikel\r\n\t\tWHERE DeletedKind.kEigenschaftKombi > 0;\r\n\tEND;\r\n\r\n\t--\r\n\t-- Amazon-Mappings aufräumen\r\n\t--\r\n\tDELETE pf_amazon_angebot_mapping\r\n\tFROM dbo.pf_amazon_angebot_mapping \r\n\tJOIN DELETED ON DELETED.kArtikel = pf_amazon_angebot_mapping.kArtikel;\r\n \r\nEND TRY\r\nBEGIN CATCH\r\n BEGIN TRY\r\n DECLARE @DeadlockRetries TINYINT = 0;\r\n EXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n END TRY\r\n BEGIN CATCH\r\n IF ERROR_NUMBER() <> 266 THROW;\r\n END CATCH;\r\n THROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"triggerName": "tgr_tartikel_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tartikel_INSUP]\r\nON [dbo].[tArtikel]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n\r\n\r\n IF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n IF NOT EXISTS(SELECT 1 FROM INSERTED) RETURN; -- INSERT, UPDATE, INSUP - Trigger\r\n\r\n -- Falls notwendig - raus hier wenn das ein gezielter rekursiver Aufruf ist\r\n IF (CONTEXT_INFO() IN (0x696969)) RETURN;\r\n\r\n DECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n DECLARE @MyContextInfo VARBINARY(128) = HASHBYTES('SHA1', 'tgr_tartikel_INSUP');\r\n SET CONTEXT_INFO @MyContextInfo;\r\n\r\n -- Start des Triggercodes\r\n\r\n IF OBJECT_ID('tempdb..#ModifiedItems') IS NOT NULL\r\n BEGIN\r\n DROP TABLE #ModifiedItems;\r\n END\r\n CREATE TABLE #ModifiedItems (\r\n kArtikel INT NOT NULL PRIMARY KEY,\r\n cAktiv CHAR(1) NOT NULL,\r\n cTeilbar CHAR(1) NOT NULL,\r\n cArtNr VARCHAR(100) NOT NULL,\r\n fVKNetto DECIMAL(28, 14) NOT NULL,\r\n cAktivChanged BIT NOT NULL,\r\n nAutomatischeLiefertageberechnungIstAktiviert BIT NOT NULL,\r\n cArtNrChanged BIT NOT NULL,\r\n nVKNettoChanged BIT NOT NULL,\r\n nLagerInaktiv BIT NOT NULL,\r\n nNeuerBestand BIT NOT NULL,\r\n nGewichtGeaendert BIT NOT NULL,\r\n nArtikelspeicherGeaendert BIT NOT NULL,\r\n nNeedDummyWarenlagerplatz BIT NOT NULL,\r\n nBestandLoeschen BIT NOT NULL,\r\n kStueckliste INT NOT NULL,\r\n nMindestbestandChanged BIT NOT NULL,\r\n nMindestbestandNeu DECIMAL(25,13) NOT NULL,\r\n cTeilbarChanged BIT NOT NULL,\r\n cAsin NVARCHAR(30) NULL,\r\n nSeriennummernVerfolgungChanged BIT NOT NULL,\r\n nLagerArtikelChanged BIT NOT NULL);\r\n\r\n\r\n INSERT INTO #ModifiedItems (kArtikel, cAktiv, cTeilbar, cArtNr, fVKNetto, cAktivChanged, cTeilbarChanged, nAutomatischeLiefertageberechnungIstAktiviert, cArtNrChanged, nVKNettoChanged, nLagerInaktiv, nNeuerBestand, nGewichtGeaendert, nArtikelspeicherGeaendert, nNeedDummyWarenlagerplatz, nBestandLoeschen, kStueckliste, nMindestbestandChanged, nMindestbestandNeu, cAsin, nSeriennummernVerfolgungChanged,nLagerArtikelChanged)\r\n SELECT\r\n INSERTED.kArtikel,\r\n INSERTED.cAktiv,\r\n INSERTED.cTeilbar,\r\n INSERTED.cArtNr,\r\n INSERTED.fVKNetto,\r\n CASE WHEN EXISTS(SELECT INSERTED.cAktiv EXCEPT SELECT DELETED.cAktiv) THEN 1 ELSE 0 END AS cAktivChanged,\r\n CASE WHEN EXISTS(SELECT INSERTED.cTeilbar EXCEPT SELECT DELETED.cTeilbar) THEN 1 ELSE 0 END AS cTeilbarChanged,\r\n CASE WHEN INSERTED.nAutomatischeLiefertageberechnung = 1 THEN 1 ELSE 0 END AS nAutomatischeLiefertageberechnungIstAktiviert,\r\n CASE WHEN EXISTS(SELECT INSERTED.cArtNr EXCEPT SELECT DELETED.cArtNr) THEN 1 ELSE 0 END AS cArtNrChanged,\r\n CASE WHEN EXISTS(SELECT INSERTED.fVKNetto EXCEPT SELECT DELETED.fVKNetto) THEN 1 ELSE 0 END AS nVKNettoChanged,\r\n CASE WHEN INSERTED.cLagerAktiv = 'N' AND DELETED.cLagerAktiv = 'Y' THEN 1 ELSE 0 END AS nLagerInaktiv,\r\n CASE WHEN INSERTED.kStueckliste = 0 AND INSERTED.nIstVater = 0 AND EXISTS(SELECT INSERTED.kStueckliste,\r\n INSERTED.nIstVater,\r\n INSERTED.cLagerVariation,\r\n INSERTED.cLagerAktiv,\r\n INSERTED.cLagerKleinerNull,\r\n INSERTED.cTeilbar,\r\n INSERTED.kVaterArtikel,\r\n INSERTED.nPuffer EXCEPT SELECT DELETED.kStueckliste,\r\n DELETED.nIstVater,\r\n DELETED.cLagerVariation,\r\n DELETED.cLagerAktiv,\r\n DELETED.cLagerKleinerNull,\r\n DELETED.cTeilbar,\r\n DELETED.kVaterArtikel,\r\n DELETED.nPuffer) THEN 1 ELSE 0\r\n END AS nNeuerBestand,\r\n CASE WHEN EXISTS(SELECT INSERTED.fGewicht, INSERTED.fArtGewicht EXCEPT SELECT DELETED.fGewicht, DELETED.fArtGewicht) THEN 1 ELSE 0 END AS nGewichtGeaendert,\r\n CASE WHEN EXISTS(SELECT INSERTED.cArtNr, INSERTED.cBarcode, INSERTED.cHAN, INSERTED.cUPC, INSERTED.cISBN, INSERTED.cASIN, INSERTED.cJfsku, INSERTED.cAmazonFNSKU, INSERTED.kStueckliste EXCEPT SELECT DELETED.cArtNr, DELETED.cBarcode, DELETED.cHAN, DELETED.cUPC, DELETED.cISBN, DELETED.cASIN, DELETED.cJfsku, DELETED.cAmazonFNSKU, DELETED.kStueckliste) THEN 1 ELSE 0 END AS nArtikelspeicherGeaendert,\r\n CASE WHEN INSERTED.kArtikel NOT IN (SELECT kArtikel FROM DELETED) AND INSERTED.cLagerVariation <> 'Y' AND INSERTED.cAktiv = 'Y' THEN 1 ELSE 0 END AS nNeedDummyWarenlagerplatz,\r\n CASE WHEN (INSERTED.kStueckliste > 0 OR INSERTED.nIstVater > 0)\r\n AND EXISTS (SELECT INSERTED.kStueckliste, INSERTED.nIstVater EXCEPT SELECT DELETED.kStueckliste, DELETED.nIstVater)\r\n THEN 1\r\n ELSE 0\r\n END AS nBestandLoeschen,\r\n INSERTED.kStueckliste,\r\n CASE WHEN EXISTS(SELECT INSERTED.nMidestbestand EXCEPT SELECT DELETED.nMidestbestand) THEN 1 ELSE 0 END AS nMindestbestandChanged,\r\n INSERTED.nMidestbestand AS nMindestbestandNeu,\r\n INSERTED.cASIN AS cAsin,\r\n CASE WHEN EXISTS(SELECT INSERTED.nSeriennummernVerfolgung EXCEPT SELECT DELETED.nSeriennummernVerfolgung) THEN 1 ELSE 0 END AS nSeriennummernVerfolgungChanged,\r\n CASE WHEN EXISTS(SELECT INSERTED.cLagerArtikel EXCEPT SELECT DELETED.cLagerArtikel) THEN 1 ELSE 0 END AS nLagerArtikelChanged\r\n FROM INSERTED\r\n LEFT JOIN DELETED ON DELETED.kArtikel = INSERTED.kArtikel\r\n WHERE EXISTS(\r\n SELECT\r\n INSERTED.cAktiv,\r\n INSERTED.nAutomatischeLiefertageberechnung,\r\n INSERTED.cArtNr,\r\n INSERTED.fVKNetto,\r\n INSERTED.kStueckliste,\r\n INSERTED.nIstVater,\r\n INSERTED.cLagerVariation,\r\n INSERTED.cLagerAktiv,\r\n INSERTED.cLagerKleinerNull,\r\n INSERTED.cTeilbar,\r\n INSERTED.kVaterArtikel,\r\n INSERTED.nPuffer,\r\n INSERTED.fEKNetto,\r\n INSERTED.fArtGewicht,\r\n INSERTED.fGewicht,\r\n INSERTED.nBearbeitungszeit,\r\n INSERTED.nLiefertageWennAusverkauft,\r\n INSERTED.cBarcode,\r\n INSERTED.cHAN,\r\n INSERTED.cUPC,\r\n INSERTED.cISBN,\r\n INSERTED.cASIN,\r\n INSERTED.cJfsku,\r\n INSERTED.cAmazonFNSKU,\r\n INSERTED.nMidestbestand,\r\n INSERTED.nSeriennummernVerfolgung,\r\n INSERTED.cLagerArtikel\r\n EXCEPT SELECT\r\n DELETED.cAktiv,\r\n DELETED.nAutomatischeLiefertageberechnung,\r\n DELETED.cArtNr,\r\n DELETED.fVKNetto,\r\n DELETED.kStueckliste,\r\n DELETED.nIstVater,\r\n DELETED.cLagerVariation,\r\n DELETED.cLagerAktiv,\r\n DELETED.cLagerKleinerNull,\r\n DELETED.cTeilbar,\r\n DELETED.kVaterArtikel,\r\n DELETED.nPuffer,\r\n DELETED.fEKNetto,\r\n DELETED.fArtGewicht,\r\n DELETED.fGewicht,\r\n DELETED.nBearbeitungszeit,\r\n DELETED.nLiefertageWennAusverkauft,\r\n DELETED.cBarcode,\r\n DELETED.cHAN,\r\n DELETED.cUPC,\r\n DELETED.cISBN,\r\n DELETED.cASIN,\r\n DELETED.cJfsku,\r\n DELETED.cAmazonFNSKU,\r\n DELETED.nMidestbestand,\r\n DELETED.nSeriennummernVerfolgung,\r\n DELETED.cLagerArtikel);\r\n\r\n\r\n -- Bis wir das Feld nSeriennummernstatus aus der Wawi setzen, erstmal über trigger\r\n IF UPDATE(cLagerartikel) OR UPDATE(nSeriennummernVerfolgung)\r\n BEGIN\r\n IF(EXISTS(SELECT 1 FROM #ModifiedItems WHERE nSeriennummernVerfolgungChanged = 1 OR nLagerArtikelChanged = 1 ))\r\n BEGIN\r\n SET CONTEXT_INFO 0x696969; -- Diesen Trigger nicht mehr aufrufen aus folgendem Code\r\n UPDATE dbo.tArtikel\r\n SET tArtikel.nSeriennummernstatus = CASE\r\n WHEN cLagerArtikel = 'N' THEN 0\r\n WHEN nSeriennummernVerfolgung = 0 THEN 1\r\n WHEN nSeriennummernVerfolgung = 1 THEN 2\r\n END\r\n FROM dbo.tArtikel\r\n JOIN #ModifiedItems ON #ModifiedItems.kArtikel = tArtikel.kArtikel\r\n WHERE tArtikel.nSeriennummernstatus < 3 \r\n --Das WHERE hier muss wieder raus, wenn die artikel den Seruennummernstatus 3 setzen koennen\r\n\r\n\r\n SET CONTEXT_INFO @OldContextInfo;\r\n END\r\n END\r\n\r\n --\r\n -- nLiefertageWennAusverkauft setzen falls die berechnet werden sollen (1)\r\n\t-- Wird gleich gesetzt mit der Lieferzeit des Standardlieferanten des Artikels.\r\n --\r\n\tIF UPDATE(nAutomatischeLiefertageberechnung)\r\n\tBEGIN\r\n\t\tIF(EXISTS(SELECT 1 FROM #ModifiedItems WHERE nAutomatischeLiefertageberechnungIstAktiviert = 1))\r\n\t\tBEGIN\r\n\t\t\tSET CONTEXT_INFO 0x696969; -- Diesen Trigger nicht mehr aufrufen aus folgendem Code\r\n\t\t\tUPDATE dbo.tArtikel\r\n\t\t\t\tSET tArtikel.nLiefertageWennAusverkauft = tliefartikel.nLieferzeit\r\n\t\t\tFROM dbo.tArtikel\r\n\t\t\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = tArtikel.kArtikel\r\n\t\t\tJOIN dbo.tliefartikel ON #ModifiedItems.kArtikel = tliefartikel.tArtikel_kArtikel\r\n\t\t\tWHERE #ModifiedItems.nAutomatischeLiefertageberechnungIstAktiviert = 1 AND tliefartikel.nStandard = 1\r\n\t\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\t\tEND\r\n\tEND\r\n\r\n\t--\r\n\t-- Wenn nMidestbestand einen Wert > 0 erhält, soll nIstMindestbestand auf (1) gesetzt werden, sonst (0)\r\n\t--\r\n\tIF UPDATE(nMidestbestand)\r\n\tBEGIN\r\n\t\tIF(EXISTS(SELECT 1 FROM #ModifiedItems WHERE #ModifiedItems.nMindestbestandChanged = 1))\r\n\t\tBEGIN\r\n\t\t\tSET CONTEXT_INFO 0x696969; --Diesen Trigger nicht nicht rekursiv aufrufen\r\n\t\t\tUPDATE dbo.tArtikel\r\n\t\t\t\tSET tArtikel.nIstMindestbestand = CASE WHEN #ModifiedItems.nMindestbestandNeu > 0 THEN 1 ELSE 0 END\r\n\t\t\tFROM dbo.tArtikel\r\n\t\t\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = tArtikel.kArtikel AND #ModifiedItems.nMindestbestandChanged =1\r\n\t\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\t\tEND\r\n\tEND\r\n --\r\n -- Wenn Artikelnummer geupdatet dann SKU von selbsterstellten Amazon-Produktseiten nachziehen\r\n --\r\n IF (UPDATE(cArtNr))\r\n BEGIN\r\n\t\tIF(EXISTS(SELECT 1 FROM #ModifiedItems WHERE cArtNrChanged > 0))\r\n\t\tBEGIN\r\n\t\t\tUPDATE dbo.pf_amazon_Item\r\n\t\t\tSET pf_amazon_Item.cSKU = #ModifiedItems.cArtNr\r\n\t\t\tFROM dbo.pf_amazon_Item\r\n\t\t\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = pf_amazon_Item.kArtikel\r\n\t\t\tWHERE #ModifiedItems.cArtNrChanged <> 0\r\n\t\tEND\r\n END;\r\n \r\n --\r\n -- Preisänderungen in tPreisDetails vererben\r\n --\r\n\tIF UPDATE(fVKNetto)\r\n\tBEGIN\r\n\t\tIF (EXISTS(SELECT 1 FROM #ModifiedItems WHERE nVKNettoChanged = 1))\r\n\t\tBEGIN\r\n\t\t\tUPDATE dbo.tPreisDetail\r\n\t\t\tSET\r\n\t\t\t\ttPreisDetail.fNettoPreis = ISNULL(#ModifiedItems.fVKNetto, 0.0) * (1 - tPreisDetail.fProzent / 100)\r\n\t\t\tFROM dbo.tPreisDetail\r\n\t\t\tJOIN dbo.tPreis ON tPreis.kPreis = tPreisDetail.kPreis \r\n\t\t\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = tPreis.kArtikel \r\n\t\t\tWHERE #ModifiedItems.nVKNettoChanged = 1 AND tPreisDetail.fProzent <> 0.0\r\n\t\tEND\r\n\tEND\r\n \r\n --\r\n -- Prüfen auf aktiv / inaktiv geschaltete Artikel\r\n --\r\n IF UPDATE(cAktiv) \r\n\tBEGIN\r\n\t\tIF (EXISTS(SELECT 1 FROM #ModifiedItems WHERE cAktivChanged > 0))\r\n\t\tBEGIN\r\n\t\t\tIF OBJECT_ID('tempdb..#Item') IS NOT NULL \r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #Item;\r\n\t\t\tEND\r\n\r\n\t\t\tCREATE TABLE #Item (kArtikel INT NOT NULL PRIMARY KEY, cArtNr VARCHAR(100), cAktiv CHAR(1));\r\n\t\t\t\t\r\n\t\t\t-- Alle Varkombi-Kinder suchen\r\n\t\t\tINSERT INTO #Item (kArtikel, cAktiv)\r\n\t\t\tSELECT tArtikel.kArtikel, #ModifiedItems.cAktiv FROM dbo.tArtikel WITH (NOLOCK)\r\n\t\t\tJOIN #ModifiedItems ON tArtikel.kVaterArtikel = #ModifiedItems.kArtikel\r\n\t\t\tWHERE tArtikel.kVaterArtikel <> 0 AND #ModifiedItems.cAktivChanged > 0;\r\n\r\n\t\t\t-- AUf die Kinder vererben\r\n\t\t\tIF (@@ROWCOUNT > 0)\r\n\t\t\tBEGIN\r\n\t\t\t\tSET CONTEXT_INFO 0x696969; -- Diesen Trigger nicht mehr aufrufen aus folgendem Code\r\n\t\t\t\tUPDATE dbo.tArtikel\r\n\t\t\t\t\tSET tArtikel.cAktiv = #Item.cAktiv\r\n\t\t\t\tFROM dbo.tArtikel\r\n\t\t\t\tJOIN #Item ON #Item.kArtikel = tArtikel.kArtikel\r\n\t\t\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\t\t\tEND\r\n \r\n\t\t\tIF EXISTS(SELECT 1 FROM dbo.pf_amazon_angebot_ext) OR EXISTS(SELECT 1 FROM dbo.tArtikelShop)\r\n\t\t\tBEGIN\r\n\t\t\t\tDELETE #Item; -- komplett leeren\r\n\r\n\t\t\t\t-- Deaktivierte Artikel\r\n\t\t\t\tINSERT INTO #Item (kArtikel, cArtNr)\r\n\t\t\t\tSELECT kArtikel, cArtNr\r\n\t\t\t\tFROM #ModifiedItems\r\n\t\t\t\tWHERE #ModifiedItems.cAktivChanged > 0 AND #ModifiedItems.cAktiv <> 'Y';\r\n\r\n\t\t\t\t-- Kindartikel zu den Artikeln in #Item\r\n\t\t\t\tINSERT INTO #Item (kArtikel, cArtNr)\r\n\t\t\t\tSELECT tArtikel.kArtikel, tArtikel.cArtNr FROM #Item\r\n\t\t\t\tJOIN dbo.tArtikel WITH (NOLOCK) ON tArtikel.kVaterArtikel = #Item.kArtikel\r\n\t\t\t\tWHERE NOT EXISTS (SELECT #Item.kArtikel FROM #Item WHERE #Item.kArtikel = tArtikel.kArtikel);\r\n\t\t\t\r\n\t\t\t\t--\r\n\t\t\t\t-- Bei inaktiven Artikeln: Amazon aus dem Sortiment nehmen\r\n\t\t\t\t-- Zunächst wird der JOIN über die Mappingtabelle versucht. Wenn dieser Weg nicht klappt wird direkt über die SellerSKU gemacht.\r\n\t\t\t\t--\r\n\t\t\t\tUPDATE dbo.pf_amazon_angebot_ext\r\n\t\t\t\t\tSET pf_amazon_angebot_ext.nMaxBestand = 0,\r\n\t\t\t\t\t\tpf_amazon_angebot_ext.dLetzteBestandAenderung = NULL\r\n\t\t\t\tFROM dbo.pf_amazon_angebot_ext\r\n\t\t\t\tJOIN dbo.pf_amazon_angebot_mapping ON pf_amazon_angebot_mapping.cSellerSKU = pf_amazon_angebot_ext.cSellerSKU AND pf_amazon_angebot_mapping.kUser = pf_amazon_angebot_ext.kUser\r\n\t\t\t\tJOIN #Item ON #Item.kArtikel = pf_amazon_angebot_mapping.kArtikel\r\n \r\n\t\t\t\tUPDATE dbo.pf_amazon_angebot_ext\r\n\t\t\t\t\tSET pf_amazon_angebot_ext.nMaxBestand = 0,\r\n\t\t\t\t\t\tpf_amazon_angebot_ext.dLetzteBestandAenderung = NULL\r\n\t\t\t\tFROM dbo.pf_amazon_angebot_ext\r\n\t\t\t\tJOIN #Item ON #Item.cArtNr = pf_amazon_angebot_ext.cSellerSKU\r\n \r\n\t\t\t\t--\r\n\t\t\t\t-- Bei inaktiven Artikeln: Artikel aus den Shops entfernen\r\n\t\t\t\t--\r\n\t\t\t\tDELETE dbo.tArtikelShop\r\n\t\t\t\tFROM dbo.tArtikelShop\r\n\t\t\t\tJOIN #Item ON #Item.kArtikel = tArtikelShop.kArtikel\r\n\t\t\tEND\t\t\t\r\n\t\tEND\r\n\tEND\r\n \r\n --\r\n -- Wenn Artikel von LagerAktiv auf LagerInaktiv gegangen ist, gesamten Bestand ausbuchen\r\n\t-- Nur wenn von Y -> N\r\n --\r\n\tIF UPDATE(cLagerAktiv)\r\n\tBEGIN\r\n\t\tIF(EXISTS(SELECT 1 FROM #ModifiedItems WHERE nLagerInaktiv = 1))\r\n\t\tBEGIN\r\n\t\t\tDECLARE @xWarenlagerAusgaenge XML;\r\n\t\t\tSET @xWarenlagerAusgaenge = (\r\n\t\t\t\t\tSELECT DISTINCT\r\n\t\t\t\t\t\ttWarenLagerEingang.kWarenLagerEingang AS kWarenLagerEingang,\r\n\t\t\t\t\t\t0 AS kLieferscheinPos,\r\n\t\t\t\t\t\ttWarenLagerEingang.fAnzahlAktuell AS fAnzahl,\r\n\t\t\t\t\t\t'Lagerbestand deaktiviert' AS cKommentar,\r\n\t\t\t\t\t\ttWarenLagerEingang.kBenutzer AS kBenutzer,\r\n\t\t\t\t\t\t70 AS kBuchungsart\r\n\t\t\t\t\tFROM dbo.tWarenLagerEingang\r\n\t\t\t\t\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = tWarenLagerEingang.kArtikel\r\n\t\t\t\t\tWHERE tWarenLagerEingang.fAnzahlAktuell > 0\r\n\t\t\t\t\tFOR XML PATH('WarenAusgang'), TYPE\r\n\t\t\t\t);\r\n \r\n\t\t\tIF(@xWarenlagerAusgaenge IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tEXEC dbo.spWarenlagerAusgangSchreiben\r\n\t\t\t\t\t@xWarenlagerAusgaenge = @xWarenlagerAusgaenge;\r\n\t\t\tEND;\r\n\r\n\t\t\t--\r\n\t\t\t-- Löscht Bestände, wenn Lagerführung deaktiviert wurde\r\n\t\t\t--\r\n\t\t\tDELETE dbo.tlagerbestandProLagerLagerartikel \r\n\t\t\tFROM dbo.tlagerbestandProLagerLagerartikel \r\n\t\t\tJOIN INSERTED ON INSERTED.kArtikel = tlagerbestandProLagerLagerartikel.kArtikel\r\n\t\t\tWHERE tlagerbestandProLagerLagerartikel.kArtikel = INSERTED.kArtikel AND INSERTED.cLagerAktiv = 'N';\r\n\r\n\t\tEND;\r\n\tEND;\r\n\r\n\tIF UPDATE(cTeilbar)\r\n\tBEGIN\r\n\t\tIF (EXISTS (SELECT 1 FROM #ModifiedItems WHERE #ModifiedItems.cTeilbarChanged = 1))\r\n\t\tBEGIN\r\n\t\t\tSET CONTEXT_INFO 0x696969; -- Diesen Trigger nicht mehr aufrufen aus folgendem Code\r\n\r\n\t\t\tDECLARE @StuecklistenMitKomponenten TABLE (kArtikel_Stueckliste INT, kKomponente INT, cTeilbarKomponente CHAR(1));\r\n\t\t\tINSERT INTO @StuecklistenMitKomponenten(kArtikel_Stueckliste, kKomponente, cTeilbarKomponente)\r\n\t\t\tSELECT tStueckliste.kVaterArtikel, #ModifiedItems.kArtikel, #ModifiedItems.cTeilbar\r\n\t\t\tFROM #ModifiedItems\r\n\t\t\tJOIN dbo.tStueckliste ON tStueckliste.kArtikel = #ModifiedItems.kArtikel;\r\n\r\n\t\t\tUPDATE dbo.tArtikel\r\n\t\t\tSET tArtikel.cTeilbar = 'N'\r\n\t\t\tWHERE tArtikel.kArtikel IN (\r\n\t\t\t\tSELECT kArtikel_Stueckliste\r\n\t\t\t\tFROM @StuecklistenMitKomponenten\r\n\t\t\t\tWHERE cTeilbarKomponente = 'N'\r\n\t\t\t)\r\n\t\t\tAND tArtikel.cTeilbar = 'Y'\r\n\t\t\tAND tArtikel.nIstTeilmengenArtikel = 0\r\n\r\n\t\t\t-- Stuecklisten anpassen wenn die Menge von Komponenten nicht mehr teilbar sein soll.\r\n\t\t\tUPDATE dbo.tStueckliste \r\n\t\t\tSET fAnzahl = ROUND(fAnzahl,0,1) \r\n\t\t\tWHERE tStueckliste.kArtikel IN (\r\n\t\t\t\tSELECT komp.kKomponente \r\n\t\t\t\tFROM @StuecklistenMitKomponenten AS komp\r\n\t\t\t\tWHERE komp.cTeilbarKomponente = 'N'\r\n\t\t\t)\r\n\r\n\t\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\t\tEND\r\n\tEND\r\n\r\n --\r\n -- Bestände gerade ziehen \r\n -- \r\n IF EXISTS(SELECT 1 FROM #ModifiedItems WHERE nNeuerBestand <> 0)\r\n BEGIN\r\n --\r\n -- Wird die Lagerführung eines Artikels (de-)aktiviert müssen die Lagerplätze ggf. wieder angelegt werden.\r\n --\r\n INSERT INTO dbo.tWarenLagerPlatzArtikel WITH(ROWLOCK) (kWarenLagerPlatz, kArtikel)\r\n SELECT U1.kWarenLagerPlatz, U1.kArtikel FROM\r\n (\r\n SELECT \r\n\t\t\t\ttWarenLagerEingang.kWarenLagerPlatz, \r\n\t\t\t\ttWarenLagerEingang.kArtikel, \r\n\t\t\t\t0.0 AS fAnzahl\r\n FROM dbo.tWarenLagerEingang WITH(NOLOCK)\r\n LEFT JOIN tWarenLagerPlatzArtikel WITH(NOLOCK) ON tWarenLagerEingang.kArtikel = tWarenLagerPlatzArtikel.kArtikel AND tWarenLagerEingang.kWarenLagerPlatz = tWarenLagerPlatzArtikel.kWarenLagerPlatz\r\n JOIN #ModifiedItems ON tWarenLagerEingang.kArtikel = #ModifiedItems.kArtikel\r\n WHERE #ModifiedItems.nNeuerBestand <> 0\r\n\t\t\t\tAND\ttWarenLagerPlatzArtikel.kWarenLagerPlatz IS NULL\r\n AND tWarenLagerEingang.fAnzahlAktuell > 0.0\r\n GROUP BY tWarenLagerEingang.kWarenLagerPlatz, tWarenLagerEingang.kArtikel \r\n ) AS U1\r\n GROUP BY U1.kArtikel, U1.kWarenLagerPlatz, U1.fAnzahl \r\n \r\n -- Lagerbestände pro Lager neu ermitteln für betroffene Artikel\r\n DECLARE @UpdateLagerbestandProLager AS TYPE_spUpdateLagerbestandProLager;\r\n INSERT INTO @UpdateLagerbestandProLager(kArtikel, kWarenlager)\r\n\t\t\tSELECT\r\n\t\t\t\t#ModifiedItems.kArtikel,\r\n\t\t\t\ttWarenlager.kWarenlager\r\n\t\t\tFROM #ModifiedItems \r\n\t\t\tCROSS JOIN dbo.tWarenlager\r\n\t\t\tWHERE tWarenlager.nAktiv > 0 AND #ModifiedItems.nNeuerBestand <> 0\r\n \r\n IF @@ROWCOUNT > 0\r\n EXEC dbo.spUpdateLagerbestandProLager @UpdateLagerbestandProLager;\r\n \r\n -- Lagerbestände für \"normale Artikel\" schreiben\r\n DECLARE @UpdateLagerbestand AS TYPE_spUpdateLagerbestand;\r\n INSERT INTO @UpdateLagerbestand(kArtikel)\r\n SELECT\r\n #ModifiedItems.kArtikel\r\n FROM #ModifiedItems\r\n WHERE #ModifiedItems.nNeuerBestand <> 0\r\n \r\n IF @@ROWCOUNT > 0\r\n EXEC dbo.spUpdateLagerbestand @UpdateLagerbestand\r\n END\r\n\t\r\n\t-- Löscht Bestände für Artikel die zu Stücklisten oder zu Varkombivätern werden\r\n\tDELETE dbo.tlagerbestandProLagerLagerartikel\r\n\tFROM dbo.tlagerbestandProLagerLagerartikel\r\n\tJOIN #ModifiedItems ON #ModifiedItems.kArtikel = tlagerbestandProLagerLagerartikel.kArtikel\r\n\tWHERE #ModifiedItems.nBestandLoeschen = 1;\r\n \r\n --\r\n -- Stücklistenväter neu berechnen\r\n\t-- Die SP übernimmt die Prüfung ob sich auf Grund von Datenänderungen weitere Änderungen ergeben.\r\n\t-- An die SP dürfen nur noch Stücklistenväter übergeben werden.\r\n\t-- Es werden die aktualisierten Artikel (nur Stücklisten) übergeben sowie die Stücklistenväter von aktualisierten Komponenten (Union)\r\n --\r\n\tDECLARE @Stuecklisten AS Artikel.TYPE_spAktualisiereStueckliste;\r\n\t\r\n\tINSERT INTO @Stuecklisten (kArtikel_Stueckliste, nEnforceUpdateLagerbestand)\r\n\tSELECT DISTINCT Items.kArtikel, 1 AS nEnforceUpdateLagerbestand --lagerberstand update forcieren\r\n\tFROM (\r\n\t\tSELECT #ModifiedItems.kArtikel AS kArtikel\r\n\t\tFROM #ModifiedItems\r\n\t\tWHERE #ModifiedItems.kStueckliste <> 0\r\n\t\tUNION ALL\r\n\t\tSELECT tStueckliste.kVaterArtikel AS kArtikel\r\n\t\tFROM #ModifiedItems\r\n\t\tJOIN dbo.tStueckliste WITH (NOLOCK) ON tStueckliste.kArtikel = #ModifiedItems.kArtikel\r\n\t\tWHERE #ModifiedItems.kStueckliste = 0\r\n\t) AS Items\r\n\tIF (@@ROWCOUNT > 0)\r\n\tBEGIN\r\n\t\tEXEC Artikel.spAktualisiereStueckliste @Stuecklisten; \r\n\tEND\r\n\r\n\t--\r\n\t-- Varkombiväter neu berechnen\r\n\t-- Die SP übernimmt die Prüfung ob auf Grund von Datenänderungen weitere Änderungen ergeben.\r\n\t-- An die SP dürfen nur noch Vaterartikel übergeben werden.\r\n\t-- Es werden die aktualisierten Artikel (nur Varkombiväter) übergeben sowie die Väter von aktualisierten Kindartikeln (Union)\r\n --\r\n\tDECLARE @AktualisiereVarkombivater TYPE_spAktualisiereVarkombivater;\r\n\tINSERT INTO @AktualisiereVarkombivater (kArtikel)\r\n\tSELECT DISTINCT Items.kArtikel\r\n\tFROM (\r\n\t\tSELECT \r\n\t\t\tINSERTED.kArtikel AS kArtikel\r\n\t\tFROM INSERTED\r\n\t\tWHERE INSERTED.nIstVater <> 0\r\n\t\tUNION ALL\r\n\t\tSELECT\r\n\t\t\tINSERTED.kVaterArtikel AS kArtikel\r\n\t\tFROM INSERTED\r\n\t\tWHERE INSERTED.kVaterArtikel <> 0\r\n\t\tUNION ALL\r\n\t\tSELECT\r\n\t\t\tDELETED.kVaterArtikel AS kArtikel\r\n\t\tFROM DELETED\r\n\t\tWHERE DELETED.kVaterArtikel <> 0\r\n\t) AS Items\r\n\tIF (@@ROWCOUNT > 0)\r\n\tBEGIN\r\n\t\tEXEC Artikel.spAktualisiereVarkombivater @AktualisiereVarkombivater; \r\n\tEND\r\n \r\n --\r\n\t-- prueft ob cASIN auch in Artikel.tArtikelAsin steht\r\n\t--\r\n\tIF UPDATE(cASIN)\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #ModifiedItems WHERE #ModifiedItems.cAsin <> '')\r\n\t\tBEGIN\r\n\t\t\tMERGE Artikel.tArtikelAsin AS TargetTable\r\n\t\t\tUSING\r\n\t\t\t(\r\n\t\t\t\tSELECT #ModifiedItems.kArtikel,\r\n\t\t\t\t\t #ModifiedItems.cAsin\r\n\t\t\t\tFROM #ModifiedItems\r\n\t\t\t\tWHERE #ModifiedItems.cAsin <> ''\r\n\t\t\t) AS SourceTable\r\n\t\t\tON SourceTable.kArtikel = TargetTable.kArtikel\r\n\t\t\t AND SourceTable.cAsin = TargetTable.cAsin\r\n\t\t\tWHEN NOT MATCHED BY TARGET THEN\r\n\t\t\t\tINSERT\r\n\t\t\t\t(\r\n\t\t\t\t\tkArtikel,\r\n\t\t\t\t\tcAsin\r\n\t\t\t\t)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(SourceTable.kArtikel, SourceTable.cAsin);\r\n\t\tEND;\r\n\tEND;\r\n\r\n\t--\r\n\t-- Artikelspeicher aktualisieren\r\n\t--\r\n\tDECLARE @AktualisiereArtikelspeicher Artikel.TYPE_spAktualisiereArtikelspeicher;\r\n\tINSERT INTO @AktualisiereArtikelspeicher\r\n\tSELECT DISTINCT #ModifiedItems.kArtikel FROM #ModifiedItems WHERE #ModifiedItems.nArtikelspeicherGeaendert <> 0;\r\n\tIF (@@ROWCOUNT > 0)\r\n\tBEGIN\r\n\t\tEXEC Artikel.spAktualisiereArtikelspeicher @AktualisiereArtikelspeicher;\r\n\tEND\r\n \r\n --\r\n -- Bei Änderung des Artikel-Gewichtes müssen für alle zugeordneten laufenden eBay-Angebote die Versand-Bedingungen neu abgeglichen werden.\r\n --\r\n\tIF (UPDATE(fGewicht) OR UPDATE(fArtGewicht))\r\n\tBEGIN\r\n\t\tDECLARE @ebayItemLaufend AS TABLE(kItem INT);\r\n\t\tINSERT @ebayItemLaufend\r\n\t\tSELECT ebay_item.kItem\r\n\t\tFROM #ModifiedItems\r\n\t\tJOIN dbo.ebay_item WITH (NOLOCK) ON ebay_item.kArtikel = #ModifiedItems.kArtikel\r\n\t\tWHERE #ModifiedItems.nGewichtGeaendert <> 0 AND ebay_item.Status IN (3, 7) \r\n\r\n\t\tIF (@@ROWCOUNT > 0)\r\n\t\tBEGIN\r\n\t\t\tMERGE INTO dbo.ebay_geaenderte_laufende_angebote WITH(HOLDLOCK)\r\n\t\t\tUSING @ebayItemLaufend\r\n\t\t\tON [@ebayItemLaufend].kItem = ebay_geaenderte_laufende_angebote.kItem\r\n\t\t\tWHEN MATCHED THEN\r\n\t\t\t\tUPDATE SET nChanges = ebay_geaenderte_laufende_angebote.nChanges | 16\r\n\t\t\tWHEN NOT MATCHED BY TARGET THEN\r\n\t\t\t\tINSERT (kItem, nChanges, nTryUpload) VALUES ([@ebayItemLaufend].kItem, 16, 1);\r\n\t\tEND\r\n\tEND\r\n\r\nEND TRY\r\nBEGIN CATCH\r\n\tBEGIN TRY\r\n\t\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\t\tEXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tEND TRY\r\n\tBEGIN CATCH\r\n\t\tIF ERROR_NUMBER() <> 266 THROW;\r\n\tEND CATCH;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"triggerName": "tgr_tArtikel_Sync_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikel_Sync_DEL]\r\nON [dbo].[tArtikel]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\t\r\n\tUPDATE Sync.tEntityPlatform\r\n\tSET tEntityPlatform.dInactive = GETDATE()\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN Deleted ON Deleted.kArtikel = tEntityPlatform.kEntityId\r\n\tWHERE tEntityPlatform.nEntityType = 1\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikel",
|
|
"triggerName": "tgr_tArtikel_Sync_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikel_Sync_INSUP]\r\nON [dbo].[tArtikel]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM INSERTED) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF(NOT (UPDATE(fVKNetto) OR UPDATE(fEKNetto) OR UPDATE(cArtNr) OR UPDATE(fUVP) OR UPDATE(cAktiv) OR UPDATE(nMidestbestand) OR \r\n\t\tUPDATE(nMindestbestellmaenge) OR UPDATE(fGewicht) OR UPDATE(cNeu) OR UPDATE(cLagerAktiv) OR UPDATE(cLagerKleinerNull) OR \r\n\t\tUPDATE(cLagerVariation) OR UPDATE(fPackeinheit) OR UPDATE(fVPEWert) OR UPDATE(kSteuerklasse) OR UPDATE(dErscheinungsdatum) OR \r\n\t\tUPDATE(fArtGewicht) OR UPDATE(kEigenschaftKombi) OR UPDATE(kVaterArtikel) OR UPDATE(dNeuImSortiment) OR\r\n\t\tUPDATE(nIstVater) OR UPDATE(fAbnahmeintervall) OR UPDATE(kStueckliste) OR UPDATE(kWarengruppe) OR UPDATE(nMHD) OR UPDATE(nCharge) OR \r\n\t\tUPDATE(nNichtBestellbar) OR UPDATE(nPufferTyp) OR UPDATE(nPuffer) OR UPDATE(fGrundpreisMenge) OR UPDATE(fBreite) OR UPDATE(fHoehe) OR\r\n\t\tUPDATE(fLaenge) OR UPDATE(dZulaufVerfuegbarAm) OR UPDATE(nZulaufVerfuegbarMenge) OR UPDATE(nBearbeitungszeit) OR UPDATE(kVPEEinheit) OR\r\n\t\tUPDATE(nLiefertageWennAusverkauft) OR UPDATE(kVerkaufsEinheit) OR UPDATE(kHersteller) OR UPDATE(kLieferStatus) OR UPDATE(kMassEinheit) OR\r\n\t\tUPDATE(kGrundPreisEinheit) OR UPDATE(cAnmerkung) OR UPDATE(cBarcode) OR UPDATE(cTopArtikel) OR UPDATE(cLagerArtikel) OR UPDATE(cTeilbar) OR\r\n\t\tUPDATE(nVPE) OR UPDATE(cSuchbegriffe) OR UPDATE(cTaric) OR UPDATE(cHerkunftsland) OR UPDATE(nSort) OR UPDATE(kVersandklasse) OR UPDATE(cHAN) OR\r\n\t\tUPDATE(cSerie) OR UPDATE(cISBN) OR UPDATE(cUNNummer) OR UPDATE(cGefahrnr) OR UPDATE(cASIN) OR UPDATE(nIstMindestbestand) OR UPDATE(cUPC) OR\r\n\t\tUPDATE(cEPID) OR UPDATE(nAutomatischeLiefertageberechnung)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\t\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelSync') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelSync;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelSync\r\n\t(\r\n\t\tkArtikel INT NOT NULL, \r\n\t\tkStuecklisteNeu INT NOT NULL,\r\n\t\tkVaterArtikelNeu INT NOT NULL,\r\n\t\tkVaterArtikelAlt INT NULL,\r\n\t\tcAktivNeu NVARCHAR(1), \r\n\t\tnStueckliste BIT NOT NULL,\r\n\t\tnStuecklisteNotNull BIT NOT NULL,\r\n\t\tnPreis BIT NOT NULL,\r\n nLagerKleinerNull BIT NOT NULL,\r\n\t\tnAktiv BIT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnConnectorBlock BIT NOT NULL,\r\n\t\tnVaterArtikel BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelSync (kArtikel, kStuecklisteNeu, kVaterArtikelNeu, kVaterArtikelAlt, cAktivNeu, nStueckliste, nStuecklisteNotNull,\r\n\t\t\t\t\t\t\t\t nPreis, nLagerKleinerNull, nAktiv, nPosBlock, nConnectorBlock, nVaterArtikel)\r\n\t\tSELECT\t\r\n\t\t\tInserted.kArtikel AS kArtikel,\r\n\t\t\tInserted.kStueckliste AS kStuecklisteNeu,\r\n\t\t\tInserted.kVaterArtikel AS kVaterArtikelNeu,\r\n\t\t\tDeleted.kVaterArtikel AS kVaterArtikelAlt,\r\n\t\t\tInserted.cAktiv AS cAktivNeu,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kStueckliste EXCEPT SELECT Deleted.kStueckliste) THEN 1 ELSE 0 END AS nStueckliste,\r\n\t\t\tCASE WHEN Inserted.kStueckliste > 0 THEN 1 ELSE 0 END AS nStuecklisteNotNull,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT Inserted.fVKNetto, Inserted.nNichtRabattfaehig\r\n\t\t\t\tEXCEPT \r\n\t\t\t\tSELECT Deleted.fVKNetto, Deleted.nNichtRabattfaehig\r\n\t\t\t) THEN 1 ELSE 0 END AS nPreis,\r\n CASE WHEN EXISTS\r\n (\r\n SELECT Inserted.cLagerKleinerNull\r\n EXCEPT\r\n SELECT Deleted.cLagerKleinerNull\r\n ) THEN 1 ELSE 0 END AS nLagerKleinerNull,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cAktiv EXCEPT SELECT Deleted.cAktiv) THEN 1 ELSE 0 END AS nAktiv,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.nSort, Inserted.fVKNetto, Inserted.fEKNetto, Inserted.cArtNr, Inserted.cBarcode, Inserted.cLagerAktiv, Inserted.cTeilbar, Inserted.cAnmerkung, \r\n\t\t\t\t\t\tInserted.nIstVater, Inserted.kSteuerklasse, Inserted.cAktiv, Inserted.kStueckliste\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.nSort, Deleted.fVKNetto, Deleted.fEKNetto, Deleted.cArtNr, Deleted.cBarcode, Deleted.cLagerAktiv, Deleted.cTeilbar, Deleted.cAnmerkung, \r\n\t\t\t\t\t\tDeleted.nIstVater, Deleted.kSteuerklasse, Deleted.cAktiv, Deleted.kStueckliste\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.cArtNr, Inserted.fUVP, Inserted.cAktiv, Inserted.nMidestbestand, Inserted.nMindestbestellmaenge, Inserted.fGewicht, Inserted.cNeu, Inserted.cLagerAktiv, \r\n\t\t\t\t\t\tInserted.cLagerKleinerNull, Inserted.cLagerVariation, Inserted.fPackeinheit, Inserted.fVPEWert, Inserted.kSteuerklasse, Inserted.dErscheinungsdatum, Inserted.fArtGewicht, \r\n\t\t\t\t\t\tInserted.kEigenschaftKombi, Inserted.kVaterArtikel, Inserted.nIstVater, Inserted.fAbnahmeintervall, Inserted.kStueckliste, Inserted.kWarengruppe, Inserted.nMHD, Inserted.nCharge, \r\n\t\t\t\t\t\tInserted.nNichtBestellbar, Inserted.nPufferTyp, Inserted.nPuffer, Inserted.fGrundpreisMenge, Inserted.fBreite, Inserted.fHoehe, Inserted.fLaenge, Inserted.dZulaufVerfuegbarAm, \r\n\t\t\t\t\t\tInserted.nZulaufVerfuegbarMenge, Inserted.nBearbeitungszeit, Inserted.kVPEEinheit, Inserted.nLiefertageWennAusverkauft, Inserted.kVerkaufsEinheit, Inserted.kHersteller, \r\n\t\t\t\t\t\tInserted.kLieferStatus, Inserted.kMassEinheit, Inserted.kGrundPreisEinheit, Inserted.cAnmerkung, Inserted.cBarcode, Inserted.cTopArtikel, Inserted.cLagerArtikel, Inserted.cTeilbar, \r\n\t\t\t\t\t\tInserted.nVPE, Inserted.cSuchbegriffe, Inserted.cTaric, Inserted.cHerkunftsland, Inserted.nSort, Inserted.kVersandklasse, Inserted.cHAN, Inserted.cSerie, Inserted.cISBN, \r\n\t\t\t\t\t\tInserted.cUNNummer, Inserted.cGefahrnr, Inserted.cASIN, Inserted.nIstMindestbestand, Inserted.cUPC, Inserted.cEPID, Inserted.nAutomatischeLiefertageberechnung, Inserted.dNeuImSortiment, Inserted.fEKNetto\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.cArtNr, Deleted.fUVP, Deleted.cAktiv, Deleted.nMidestbestand, Deleted.nMindestbestellmaenge, Deleted.fGewicht, Deleted.cNeu, Deleted.cLagerAktiv, \r\n\t\t\t\t\t\tDeleted.cLagerKleinerNull, Deleted.cLagerVariation, Deleted.fPackeinheit, Deleted.fVPEWert, Deleted.kSteuerklasse, Deleted.dErscheinungsdatum, Deleted.fArtGewicht, \r\n\t\t\t\t\t\tDeleted.kEigenschaftKombi, Deleted.kVaterArtikel, Deleted.nIstVater, Deleted.fAbnahmeintervall, Deleted.kStueckliste, Deleted.kWarengruppe, Deleted.nMHD, Deleted.nCharge, \r\n\t\t\t\t\t\tDeleted.nNichtBestellbar, Deleted.nPufferTyp, Deleted.nPuffer, Deleted.fGrundpreisMenge, Deleted.fBreite, Deleted.fHoehe, Deleted.fLaenge, Deleted.dZulaufVerfuegbarAm, \r\n\t\t\t\t\t\tDeleted.nZulaufVerfuegbarMenge, Deleted.nBearbeitungszeit, Deleted.kVPEEinheit, Deleted.nLiefertageWennAusverkauft, Deleted.kVerkaufsEinheit, Deleted.kHersteller, \r\n\t\t\t\t\t\tDeleted.kLieferStatus, Deleted.kMassEinheit, Deleted.kGrundPreisEinheit, Deleted.cAnmerkung, Deleted.cBarcode, Deleted.cTopArtikel, Deleted.cLagerArtikel, Deleted.cTeilbar, \r\n\t\t\t\t\t\tDeleted.nVPE, Deleted.cSuchbegriffe, Deleted.cTaric, Deleted.cHerkunftsland, Deleted.nSort, Deleted.kVersandklasse, Deleted.cHAN, Deleted.cSerie, Deleted.cISBN, \r\n\t\t\t\t\t\tDeleted.cUNNummer, Deleted.cGefahrnr, Deleted.cASIN, Deleted.nIstMindestbestand, Deleted.cUPC, Deleted.cEPID, Deleted.nAutomatischeLiefertageberechnung,\r\n\t\t\t\t\t\tDeleted.dNeuImSortiment, Deleted.fEKNetto\r\n\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nConnectorBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kVaterArtikel EXCEPT SELECT Deleted.kVaterArtikel) THEN 1 ELSE 0 END AS nVaterArtikel\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kArtikel = Inserted.kArtikel;\r\n\t\r\n\t--\r\n\t--POS\r\n\t--\r\n\tIF (UPDATE(nSort) OR UPDATE(fVKNetto) OR UPDATE(fEKNetto) OR UPDATE(cArtNr) OR UPDATE(cBarcode) OR\r\n\t\tUPDATE(cLagerAktiv) OR UPDATE(cTeilbar) OR UPDATE(cAnmerkung) OR UPDATE(nIstVater) OR UPDATE(kSteuerklasse) OR\r\n\t\tUPDATE(cAktiv) OR UPDATE(kStueckliste))\r\n\tBEGIN \r\n\t\t--\r\n\t\t-- SyncType 4 = POS\r\n\t\t-- EntityType 1 = Artikel\r\n\t\t-- EntityType 7 = Stueckliste\r\n\t\t--\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND #tgrtArtikelSync.nPosBlock = 1;\r\n\t\tEND\r\n\t\t\r\n\t\tIF (UPDATE(kStueckliste))\r\n\t\tBEGIN\t\r\n\t\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nStueckliste = 1)\r\n\t\t\tBEGIN\r\n\t\t\t\tIF (OBJECT_ID('tempdb..#tgr_tArtikel_Sync_StuecklistePlatform') IS NOT NULL)\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tDROP TABLE #tgr_tArtikel_Sync_StuecklistePlatform;\r\n\t\t\t\tEND\r\n\r\n\t\t\t\tCREATE TABLE #tgr_tArtikel_Sync_StuecklistePlatform\r\n\t\t\t\t(\r\n\t\t\t\t\tkEntityId INT,\r\n\t\t\t\t\tnEntityType TINYINT,\r\n\t\t\t\t\tkShop INT,\r\n\t\t\t\t\tnSyncType TINYINT\r\n\t\t\t\t);\r\n\r\n\t\t\t\tINSERT INTO #tgr_tArtikel_Sync_StuecklistePlatform (kEntityId, nEntityType, kShop, nSyncType)\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tStueckliste.kStuecklisteNeu,\r\n\t\t\t\t\t\t7 AS nEntityType,\r\n\t\t\t\t\t\tStueckliste.kShop AS kShop,\r\n\t\t\t\t\t\ttShop.nTyp AS nSyncType\r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t\t#tgrtArtikelSync.kStuecklisteNeu,\r\n\t\t\t\t\t\t\ttEntityPlatform.kShop\r\n\t\t\t\t\t\tFROM #tgrtArtikelSync\r\n\t\t\t\t\t\tJOIN Sync.tEntityPlatform ON tEntityPlatform.kEntityId = #tgrtArtikelSync.kArtikel\r\n\t\t\t\t\t\t\tAND tEntityPlatform.nEntityType = 1\r\n\t\t\t\t\t\tWHERE tEntityPlatform.dInactive IS NULL\r\n\t\t\t\t\t\t\tAND #tgrtArtikelSync.nStueckliste = 1\r\n\t\t\t\t\t\t\tAND #tgrtArtikelSync.nStuecklisteNotNull = 1\r\n\t\t\t\t\t) AS Stueckliste\r\n\t\t\t\t\tLEFT JOIN Sync.tEntityPlatform ON tEntityPlatform.kEntityId = Stueckliste.kStuecklisteNeu\r\n\t\t\t\t\t\tAND tEntityPlatform.nEntityType = 7\r\n\t\t\t\t\t\tAND tEntityPlatform.kShop = Stueckliste.kShop\r\n\t\t\t\t\tJOIN dbo.tShop ON tShop.kShop = Stueckliste.kShop\r\n\t\t\t\t\tWHERE tEntityPlatform.kEntityId IS NULL\r\n\t\t\t\t\t\tAND tEntityPlatform.dInactive IS NULL;\r\n\r\n\t\t\t\tINSERT INTO Sync.tEntityPlatform (kEntityId, nEntityType, kShop, dActive, dInactive)\r\n\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.kEntityId,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.nEntityType,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.kShop,\r\n\t\t\t\t\t\tGETDATE() AS dActive,\r\n\t\t\t\t\t\tNULL AS dInactive\r\n\t\t\t\t\tFROM #tgr_tArtikel_Sync_StuecklistePlatform\r\n\t\t\r\n\t\t\t\tINSERT INTO Sync.tEntityTracking (kEntityId, nEntityType, nSyncType, dCreated, dLastModified)\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.kEntityId,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.nEntityType,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.nSyncType,\r\n\t\t\t\t\t\tGETDATE() AS dCreated,\r\n\t\t\t\t\t\tNULL AS dLastModified\r\n\t\t\t\t\tFROM #tgr_tArtikel_Sync_StuecklistePlatform\r\n\t\t\t\t\tLEFT JOIN Sync.tEntityTracking ON tEntityTracking.kEntityId = #tgr_tArtikel_Sync_StuecklistePlatform.kEntityId\r\n\t\t\t\t\t\tAND tEntityTracking.nSyncType = #tgr_tArtikel_Sync_StuecklistePlatform.nSyncType\r\n\t\t\t\t\t\tAND tEntityTracking.nEntityType = #tgr_tArtikel_Sync_StuecklistePlatform.nEntityType\r\n\t\t\t\t\tWHERE tEntityTracking.kEntityId IS NULL\r\n\t\t\t\t\tGROUP BY #tgr_tArtikel_Sync_StuecklistePlatform.kEntityId,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.nEntityType,\r\n\t\t\t\t\t\t#tgr_tArtikel_Sync_StuecklistePlatform.nSyncType;\r\n\t\t\t\r\n\t\t\t\tIF (OBJECT_ID('tempdb..#tgr_tArtikel_Sync_StuecklistePlatform') IS NOT NULL)\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tDROP TABLE #tgr_tArtikel_Sync_StuecklistePlatform;\r\n\t\t\t\tEND\r\n\t\t\tEND\r\n\t\tEND\r\n\tEND\r\n\t\r\n\t--\r\n\t--Connector\r\n\t--\r\n\tIF(UPDATE(cArtNr) OR UPDATE(fVKNetto) OR UPDATE(fUVP) OR UPDATE(cAktiv) OR UPDATE(nMidestbestand) OR UPDATE(nMindestbestellmaenge) OR UPDATE(fGewicht) OR\r\n\t\tUPDATE(cNeu) OR UPDATE(cLagerAktiv) OR UPDATE(cLagerKleinerNull) OR UPDATE(cLagerVariation) OR UPDATE(fPackeinheit) OR UPDATE(fVPEWert) OR\r\n\t\tUPDATE(kSteuerklasse) OR UPDATE(dErscheinungsdatum) OR UPDATE(fArtGewicht) OR UPDATE(kEigenschaftKombi) OR UPDATE(kVaterArtikel) OR\r\n\t\tUPDATE(nIstVater) OR UPDATE(fAbnahmeintervall) OR UPDATE(kStueckliste) OR UPDATE(kWarengruppe) OR UPDATE(nMHD) OR UPDATE(nCharge) OR \r\n\t\tUPDATE(nNichtBestellbar) OR UPDATE(nPufferTyp) OR UPDATE(nPuffer) OR UPDATE(fGrundpreisMenge) OR UPDATE(fBreite) OR UPDATE(fHoehe) OR\r\n\t\tUPDATE(fLaenge) OR UPDATE(dZulaufVerfuegbarAm) OR UPDATE(nZulaufVerfuegbarMenge) OR UPDATE(nBearbeitungszeit) OR UPDATE(kVPEEinheit) OR\r\n\t\tUPDATE(nLiefertageWennAusverkauft) OR UPDATE(kVerkaufsEinheit) OR UPDATE(kHersteller) OR UPDATE(kLieferStatus) OR UPDATE(kMassEinheit) OR\r\n\t\tUPDATE(kGrundPreisEinheit) OR UPDATE(cAnmerkung) OR UPDATE(cBarcode) OR UPDATE(cTopArtikel) OR UPDATE(cLagerArtikel) OR UPDATE(cTeilbar) OR\r\n\t\tUPDATE(nVPE) OR UPDATE(cSuchbegriffe) OR UPDATE(cTaric) OR UPDATE(cHerkunftsland) OR UPDATE(nSort) OR UPDATE(kVersandklasse) OR UPDATE(cHAN) OR\r\n\t\tUPDATE(cSerie) OR UPDATE(cISBN) OR UPDATE(cUNNummer) OR UPDATE(cGefahrnr) OR UPDATE(cASIN) OR UPDATE(nIstMindestbestand) OR UPDATE(cUPC) OR\r\n\t\tUPDATE(cEPID) OR UPDATE(dZulaufVerfuegbarAm) OR UPDATE(nZulaufVerfuegbarMenge) OR UPDATE(nAutomatischeLiefertageberechnung) OR \r\n\t\tUPDATE(dErscheinungsdatum) OR UPDATE(dNeuImSortiment) OR UPDATE(fEkNetto))\r\n\tBEGIN\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nStueckliste = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Stücklistenkomponenten senden\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN\r\n\t\t\t(\r\n\t\t\t\tSELECT\r\n\t\t\t\t\ttArtikel.kArtikel,\r\n\t\t\t\t\ttArtikelShop.kShop\r\n\t\t\t\tFROM dbo.tArtikel\r\n\t\t\t\tJOIN dbo.tStueckliste ON tArtikel.kStueckliste = tStueckliste.kStueckliste\r\n\t\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tStueckliste.kArtikel\r\n\t\t\t\tJOIN dbo.tArtikelShop ON #tgrtArtikelSync.kArtikel = tArtikelShop.kArtikel\t\t\t\r\n\t\t\t\tWHERE #tgrtArtikelSync.nStueckliste = 1\r\n\t\t\t\t\tAND (tArtikelShop.cInet != 'N'\r\n\t\t\t\t\tOR tArtikelShop.nAktion > 0)\r\n\t\t\t) AS UpdatedItems ON dbo.tArtikelShop.kArtikel = updatedItems.kArtikel\r\n\t\t\t\tAND tArtikelShop.kShop = UpdatedItems.kShop\r\n\t\t\tWHERE tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nPreis = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Preise senden\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 2,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tArtikelShop.kArtikel\r\n\t\t\t\tAND #tgrtArtikelSync.nPreis = 1\r\n\t\t\tWHERE #tgrtArtikelSync.nPreis = 1\r\n\t\t\t\tAND (tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,1,4,5,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1);\r\n\t\tEND\r\n\t\t \r\n IF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nLagerKleinerNull = 1)\r\n BEGIN\r\n --\r\n -- Bestände senden\r\n --\r\n UPDATE dbo.tArtikelShop\r\n SET tArtikelShop.nAktion = tArtikelShop.nAktion | 4,\r\n tArtikelShop.cInet = 'Y',\r\n tArtikelShop.nInBearbeitung = 0\r\n FROM dbo.tArtikelShop\r\n JOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tArtikelShop.kArtikel\r\n AND #tgrtArtikelSync.nLagerKleinerNull = 1\r\n WHERE #tgrtArtikelSync.nLagerKleinerNull = 1\r\n AND (tArtikelShop.cInet = 'N'\r\n OR tArtikelShop.nAktion IN (0,1,4,5,8)\r\n OR tArtikelShop.nInBearbeitung = 1);\r\n END\r\n\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nConnectorBlock = 1)\r\n\t\tBEGIN \r\n\t\t\t--\r\n\t\t\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t\t\t--\r\n\t\t\tUPDATE tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tArtikelShop.kArtikel\r\n\t\t\tWHERE #tgrtArtikelSync.nConnectorBlock = 1\r\n\t\t\t\tAND (tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1);\r\n\t\tEND\r\n\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nAktiv = 1)\r\n\t\tBEGIN\r\n\t\t\tDELETE dbo.tArtikelShop\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kArtikel = tArtikelShop.kArtikel\r\n\t\t\tWHERE #tgrtArtikelSync.nAktiv = 1\r\n\t\t\t\tAND #tgrtArtikelSync.cAktivNeu = 'N'\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtArtikelSync WHERE #tgrtArtikelSync.nVaterArtikel = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Varkombi-Väter zum Abgleich anstoßen, wenn sich der Varkombi-Vater des Kindes geändert hat\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtArtikelSync ON #tgrtArtikelSync.kVaterArtikelNeu = tArtikelShop.kArtikel\r\n\t\t\t\tOR #tgrtArtikelSync.kVaterArtikelAlt = tArtikelShop.kArtikel\r\n\t\t\tWHERE (tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1)\r\n\t\t\t\tAND #tgrtArtikelSync.nVaterArtikel = 1;\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"triggerName": "jtlActionValidator_tArtikelAttribut",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tArtikelAttribut] \r\nON [dbo].[tArtikelAttribut] \r\nAFTER DELETE \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN \r\n\r\n\t--\r\n\t--Überprüfen ob Trigger mit Inhalt aufgerufen wird\r\n\t--\r\n\t\tIF((SELECT COUNT(1) FROM DELETED) = 0)\r\n\t\tBEGIN\r\n\t\t\tRETURN\r\n\t\tEND\r\n\r\n\t--\r\n\t-- tAttributArtikel aufräumen\r\n\t--\r\n\t\tDELETE tArtikelAttributSprache WITH(ROWLOCK)\r\n\t\tFROM tArtikelAttributSprache WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kArtikelAttribut = tArtikelAttributSprache.kArtikelAttribut \r\n \r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"triggerName": "tgr_tArtikelAttribut_Connector_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelAttribut_Connector_DELETE]\r\nON [dbo].[tArtikelAttribut]\r\nAFTER UPDATE, INSERT, DELETE\r\nAS\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET ANSI_WARNINGS ON;\r\nSET ANSI_PADDING ON;\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\t--Überprüfen ob Trigger gefüllt aufgerufen wird\r\n\tIF((SELECT COUNT(1) FROM INSERTED FULL JOIN DELETED ON INSERTED.kArtikelAttribut = DELETED.kArtikelAttribut) = 0)\r\n\tBEGIN \r\n\t\tRETURN;\r\n\tEND\r\n\t\r\n\tDECLARE @Komplett AS INT;\r\n\t--DECLARE @Preis AS INT;\r\n\t--DECLARE @Bestand AS INT;\r\n\r\n\tSET @Komplett = 1;\r\n\t--SET @Preis = 2;\r\n\t--SET @Bestand = 4;\r\n\t\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\t\r\n\r\n\tUPDATE dbo.tArtikelShop\r\n\t\tSET dbo.tArtikelShop.nAktion = dbo.tArtikelShop.nAktion | @Komplett,\r\n\t\t\tdbo.tArtikelShop.cInet = 'Y',\r\n\t\t\tdbo.tArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\t\r\n\tJOIN\r\n\t(\r\n\t\tSELECT DELETED.kArtikel, DELETED.kShop\r\n\t\tFROM DELETED\t\t\r\n\t) AS refreshableItems ON tArtikelShop.kArtikel = refreshableItems.kArtikel\r\n\t\tAND (dbo.tArtikelShop.kShop = refreshableItems.kShop OR refreshableItems.kShop = 0)\r\n\tWHERE dbo.tArtikelShop.cInet = 'N'\r\n\t\t\tOR dbo.tArtikelShop.nAktion & @Komplett = 0\r\n\t\t\tOR dbo.tArtikelShop.nInBearbeitung = 1;\r\n\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"triggerName": "tgr_tArtikelAttribut_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelAttribut_DEL]\r\nON [dbo].[tArtikelAttribut]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelAttributSyncDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelAttributSyncDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelAttributSyncDel\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkShop INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelAttributSyncDel (kArtikel, kShop)\r\n\t\tSELECT\r\n\t\t\tDeleted.kArtikel,\r\n\t\t\tDeleted.kShop\r\n\t\tFROM Deleted;\r\n\t\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtArtikelAttributSyncDel ON #tgrtArtikelAttributSyncDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 1\r\n\t\tAND tEntityTracking.nSyncType = 4;\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtArtikelAttributSyncDel ON #tgrtArtikelAttributSyncDel.kArtikel = tArtikelShop.kArtikel\r\n\t\tAND (tArtikelShop.kShop = #tgrtArtikelAttributSyncDel.kShop \r\n\t\t\tOR #tgrtArtikelAttributSyncDel.kShop = 0)\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttribut",
|
|
"triggerName": "tgr_tArtikelAttribut_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelAttribut_INSUP]\r\nON [dbo].[tArtikelAttribut]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM INSERTED) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF (NOT (UPDATE(kArtikel) OR UPDATE(kAttribut) OR UPDATE(kShop)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelAttributInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelAttributInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelAttributInsup\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkAttribut INT NOT NULL,\r\n\t\tnPosConnectorBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelAttributInsup (kArtikel, kAttribut, nPosConnectorBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tInserted.kAttribut,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kArtikel, Inserted.kAttribut, Inserted.kShop EXCEPT SELECT Deleted.kArtikel, Deleted.kAttribut, Deleted.kShop)\r\n\t\t\t\tTHEN 1 ELSE 0 END AS nPosConnectorBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kArtikelAttribut = Inserted.kArtikelAttribut;\r\n\r\n\tIF EXISTS(SELECT 1 FROM #tgrtArtikelAttributInsup WHERE #tgrtArtikelAttributInsup.nPosConnectorBlock = 1)\r\n\tBEGIN \r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\r\n\t\tUPDATE Sync.tEntityTracking\r\n\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\tFROM Sync.tEntityTracking\r\n\t\tJOIN #tgrtArtikelAttributInsup ON #tgrtArtikelAttributInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\tAND #tgrtArtikelAttributInsup.nPosConnectorBlock = 1;\r\n\r\n\t\t--\r\n\t\t-- Connector\r\n\t\t--\r\n\t\t--\r\n\t\t-- Artikel vollständig an alle Webshops senden in denen die entsprechenden Attribute aktiv sind\r\n\t\t--\r\n\t\tUPDATE tArtikelShop\r\n\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\tFROM dbo.tArtikelShop\r\n\t\tJOIN #tgrtArtikelAttributInsup ON #tgrtArtikelAttributInsup.kArtikel = tArtikelShop.kArtikel\r\n\t\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = #tgrtArtikelAttributInsup.kAttribut \r\n\t\t\tAND tAttributShop.kShop = tArtikelShop.kShop\r\n\t\tWHERE (tArtikelShop.cInet = 'N'\r\n\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\tOR tArtikelShop.nInBearbeitung = 1)\r\n\t\t\tAND #tgrtArtikelAttributInsup.nPosConnectorBlock = 1;\r\n\r\n\t\t--\r\n\t\t-- Artikel vollständig an alle Webshops senden in denen die entsprechenden Eigenen Felder aktiv sind\r\n\t\t--\r\n\t\tUPDATE tArtikelShop\r\n\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\tFROM tArtikelShop\r\n\t\tJOIN #tgrtArtikelAttributInsup ON #tgrtArtikelAttributInsup.kArtikel = tArtikelShop.kArtikel\r\n\t\tJOIN dbo.tAttribut ON tAttribut.kAttribut = #tgrtArtikelAttributInsup.kAttribut\r\n\t\tWHERE tAttribut.nIstFreifeld = 1 \r\n\t\t\tAND (tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1)\r\n\t\t\tAND #tgrtArtikelAttributInsup.nPosConnectorBlock = 1;\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttributSprache",
|
|
"triggerName": "tgr_tArtikelAttributSprache_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelAttributSprache_DEL]\r\nON [dbo].[tArtikelAttributSprache]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelAttributSpracheDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelAttributSpracheDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelAttributSpracheDel\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkArtikelAttribut INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelAttributSpracheDel (kArtikel, kArtikelAttribut)\r\n\t\tSELECT \r\n\t\t\ttArtikelAttribut.kArtikel,\r\n\t\t\tDeleted.kArtikelAttribut\r\n\t\tFROM Deleted\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikelAttribut = Deleted.kArtikelAttribut;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtArtikelAttributSpracheDel ON #tgrtArtikelAttributSpracheDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 1\r\n\t\tAND tEntityTracking.nSyncType = 4;\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\tUPDATE tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\t\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel\r\n\tJOIN dbo.tAttribut ON tArtikelAttribut.kAttribut = tAttribut.kAttribut\r\n\tJOIN #tgrtArtikelAttributSpracheDel ON #tgrtArtikelAttributSpracheDel.kArtikelAttribut = tArtikelAttribut.kArtikelAttribut\r\n\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tArtikelAttribut.kAttribut\r\n\t\tAND tAttributShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\r\n\tUPDATE tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\t\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel\r\n\tJOIN dbo.tAttribut ON tArtikelAttribut.kAttribut = tAttribut.kAttribut\r\n\t\tAND tAttribut.nIstFreifeld = 1\r\n\tJOIN #tgrtArtikelAttributSpracheDel ON #tgrtArtikelAttributSpracheDel.kArtikelAttribut = tArtikelAttribut.kArtikelAttribut\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelAttributSprache",
|
|
"triggerName": "tgr_tArtikelAttributSprache_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelAttributSprache_INSUP]\r\nON [dbo].[tArtikelAttributSprache]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelAttributSpracheSync') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelAttributSpracheSync;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelAttributSpracheSync\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkArtikelAttribut INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnConnectorBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelAttributSpracheSync (kArtikel, kArtikelAttribut, nPosBlock, nConnectorBlock)\r\n\t\tSELECT \r\n\t\t\ttArtikelAttribut.kArtikel,\r\n\t\t\tInserted.kArtikelAttribut,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cWertVarchar, Inserted.nWertInt, Inserted.fWertDecimal EXCEPT SELECT Deleted.cWertVarchar, Deleted.nWertInt, Deleted.fWertDecimal)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.kArtikelAttribut, Inserted.kSprache, Inserted.cWertVarchar, Inserted.nWertInt, Inserted.fWertDecimal, Inserted.dWertDateTime\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.kArtikelAttribut, Deleted.kSprache, Deleted.cWertVarchar, Deleted.nWertInt, Deleted.fWertDecimal, Deleted.dWertDateTime\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nConnectorBlock\r\n\t\tFROM Inserted\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikelAttribut = Inserted.kArtikelAttribut\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kArtikelAttribut = Inserted.kArtikelAttribut\r\n\t\t\tAND Deleted.kSprache = Inserted.kSprache\r\n\r\n\tIF (UPDATE(cWertVarchar) OR UPDATE(nWertInt) OR UPDATE(fWertDecimal))\r\n\tBEGIN\r\n \tIF EXISTS(SELECT 1 FROM #tgrtArtikelAttributSpracheSync\tWHERE #tgrtArtikelAttributSpracheSync.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtArtikelAttributSpracheSync ON #tgrtArtikelAttributSpracheSync.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND #tgrtArtikelAttributSpracheSync.nPosBlock = 1;\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtArtikelAttributSpracheSync WHERE #tgrtArtikelAttributSpracheSync.nConnectorBlock = 1)\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- Connector\r\n\t\t--\r\n\t\t--\r\n\t\t-- Artikel vollständig an alle Webshops senden in denen die entsprechenden Attribute aktiv sind\r\n\t\t--\r\n\t\tUPDATE tArtikelShop\r\n\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\tFROM dbo.tArtikelShop\t\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel\r\n\t\tJOIN dbo.tAttribut ON tArtikelAttribut.kAttribut = tAttribut.kAttribut\r\n\t\tJOIN #tgrtArtikelAttributSpracheSync ON #tgrtArtikelAttributSpracheSync.kArtikelAttribut = tArtikelAttribut.kArtikelAttribut\r\n\t\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tArtikelAttribut.kAttribut\r\n\t\t\tAND tAttributShop.kShop = tArtikelShop.kShop\r\n\t\tWHERE (tArtikelShop.cInet = 'N'\r\n\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\tOR tArtikelShop.nInBearbeitung = 1)\r\n\t\t\tAND #tgrtArtikelAttributSpracheSync.nConnectorBlock = 1;\r\n\r\n\t\tUPDATE tArtikelShop\r\n\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\tFROM dbo.tArtikelShop\t\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel\r\n\t\tJOIN dbo.tAttribut ON tArtikelAttribut.kAttribut = tAttribut.kAttribut\r\n\t\t\tAND tAttribut.nIstFreifeld = 1\r\n\t\tJOIN #tgrtArtikelAttributSpracheSync ON #tgrtArtikelAttributSpracheSync.kArtikelAttribut = tArtikelAttribut.kArtikelAttribut\r\n\t\tWHERE (tArtikelShop.cInet = 'N'\r\n\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\tOR tArtikelShop.nInBearbeitung = 1)\r\n\t\t\tAND #tgrtArtikelAttributSpracheSync.nConnectorBlock = 1;\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"triggerName": "tgr_tArtikelBeschreibung_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelBeschreibung_DEL]\r\nON [dbo].[tArtikelBeschreibung]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelBeschreibungDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelBeschreibungDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelBeschreibungDel\r\n\t(\r\n\t\tkArtikel INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelBeschreibungDel (kArtikel)\r\n\t\tSELECT \r\n\t\t\tDeleted.kArtikel\r\n\t\tFROM Deleted;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking \r\n\tJOIN #tgrtArtikelBeschreibungDel ON #tgrtArtikelBeschreibungDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 1;\r\n\t\t\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN dbo.tkonfigitem ON tkonfigitem.kKonfigitem = tEntityTracking.kEntityId\r\n\tJOIN #tgrtArtikelBeschreibungDel ON #tgrtArtikelBeschreibungDel.kArtikel = tkonfigitem.kArtikel\r\n\tWHERE tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 9;\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtArtikelBeschreibungDel ON #tgrtArtikelBeschreibungDel.kArtikel = tArtikelShop.kArtikel\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelBeschreibung",
|
|
"triggerName": "tgr_tArtikelBeschreibung_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelBeschreibung_INSUP]\r\nON [dbo].[tArtikelBeschreibung]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelBeschreibungInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelBeschreibungInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelBeschreibungInsup\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tnName BIT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelBeschreibungInsup (kArtikel, nName, nPosBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cName EXCEPT SELECT Deleted.cName) THEN 1 ELSE 0 END AS nName,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cName, Inserted.cKurzBeschreibung, Inserted.cBeschreibung EXCEPT SELECT Deleted.cName, Deleted.cKurzBeschreibung, Deleted.cBeschreibung) \r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kArtikel = Inserted.kArtikel\r\n\t\t\tAND Deleted.kSprache = Inserted.kSprache\r\n\t\t\tAND Deleted.kPlattform = Inserted.kPlattform\r\n\t\t\tAND Deleted.kShop = Inserted.kShop;\r\n\r\n\tIF (UPDATE(cName))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtArtikelBeschreibungInsup WHERE #tgrtArtikelBeschreibungInsup.nName = 1)\r\n\t\tBEGIN\r\n\t\t\tDELETE dbo.tArtikelSpeicher WITH(ROWLOCK) \r\n\t\t\tFROM dbo.tArtikelSpeicher WITH(ROWLOCK)\r\n\t\t\tJOIN #tgrtArtikelBeschreibungInsup ON #tgrtArtikelBeschreibungInsup.kArtikel = tArtikelSpeicher.kArtikel\r\n\t\t\tWHERE tArtikelSpeicher.nID = 5\r\n\t\t\t\tAND #tgrtArtikelBeschreibungInsup.nName = 1;\r\n\r\n\t\t\tINSERT INTO dbo.tArtikelSpeicher WITH(ROWLOCK) (kArtikel, cNummer, nID, nAktiv)\r\n\t\t\t\tSELECT DISTINCT \r\n\t\t\t\t\ttArtikelBeschreibung.kArtikel,\r\n\t\t\t\t\tLTRIM(RTRIM(tArtikelBeschreibung.cName)) AS Nummer,\r\n\t\t\t\t\t5 AS Art,\r\n\t\t\t\t\tCASE WHEN tOptions.cValue = '1' \r\n\t\t\t\t\t\tTHEN 1 ELSE 0 \r\n\t\t\t\t\tEND AS nAktiv\r\n\t\t\t\tFROM dbo.tArtikelBeschreibung\r\n\t\t\t\tJOIN #tgrtArtikelBeschreibungInsup ON #tgrtArtikelBeschreibungInsup.kArtikel = tArtikelBeschreibung.kArtikel \r\n\t\t\t\tLEFT JOIN dbo.tOptions WITH(NOLOCK) ON tOptions.cKey = 'ArtikelEigenschaft Artikelname'\r\n\t\t\t\tJOIN tSpracheUsed ON tArtikelBeschreibung.kSprache = tSpracheUsed.kSprache\r\n\t\t\t\t\tAND tSpracheUsed.nStandard = 1\r\n\t\t\t\tWHERE #tgrtArtikelBeschreibungInsup.nName = 1 AND tArtikelBeschreibung.cName IS NOT NULL;\r\n\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtArtikelBeschreibungInsup ON #tgrtArtikelBeschreibungInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 9\r\n\t\t\t\tAND #tgrtArtikelBeschreibungInsup.nPosBlock = 1;\r\n\t\tEND\r\n\tEND\r\n\t\r\n\tIF (UPDATE(cName) OR UPDATE(cKurzBeschreibung) OR UPDATE(cBeschreibung))\r\n\tBEGIN\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelBeschreibungInsup WHERE #tgrtArtikelBeschreibungInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking \r\n\t\t\tJOIN #tgrtArtikelBeschreibungInsup ON #tgrtArtikelBeschreibungInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND #tgrtArtikelBeschreibungInsup.nPosBlock = 1\r\n\t\tEND\r\n\tEND\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtArtikelBeschreibungInsup ON #tgrtArtikelBeschreibungInsup.kArtikel = tArtikelShop.kArtikel\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"triggerName": "tgr_tArtikelbildPlattform_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelbildPlattform_DEL]\r\nON [dbo].[tArtikelbildPlattform]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelbildPlattformDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelbildPlattformDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelbildPlattformDel\r\n\t(\r\n\t\tkArtikelbildPlattform INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tkPlattform INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tnNr INT NOT NULL,\r\n\t\tnInsertQueueBlock BIT NOT NULL,\r\n\t\tnEbayUpdateBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelbildPlattformDel (kArtikelbildPlattform, kShop, kPlattform, kArtikel, nNr, nInsertQueueBlock,\r\n\t\t\t\t\t\t\t\t\t\t\t nEbayUpdateBlock)\r\n\t\tSELECT\r\n\t\t\tDeleted.kArtikelbildPlattform,\r\n\t\t\tDeleted.kShop,\r\n\t\t\tDeleted.kPlattform,\r\n\t\t\tDeleted.kArtikel,\r\n\t\t\tDeleted.nNr,\r\n\t\t\tCASE WHEN Deleted.kShop > 0 THEN 1 ELSE 0 END AS nInsertQueueBlock,\r\n\t\t\tCASE WHEN Deleted.kPlattform = 30 AND Deleted.nNr <= 12 THEN 1 ELSE 0 END AS nEbayUpdateBlock\r\n\t\tFROM Deleted;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtArtikelbildPlattformDel ON #tgrtArtikelbildPlattformDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 1\r\n\t\tAND tEntityTracking.nSyncType = 4;\r\n\r\n\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformDel WHERE #tgrtArtikelbildPlattformDel.nInsertQueueBlock = 1)\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- tQueue für jeden gelöschten Datensatz schreiben\r\n\t\t--\r\n\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2)\r\n\t\t\tSELECT\r\n\t\t\t\t#tgrtArtikelbildPlattformDel.kShop,\r\n\t\t\t\t#tgrtArtikelbildPlattformDel.kPlattform,\r\n\t\t\t\t'tArtikelbildPlattform' AS cName,\r\n\t\t\t\t#tgrtArtikelbildPlattformDel.kArtikelbildPlattform AS kWert, \r\n\t\t\t\t2 AS nAction, \r\n\t\t\t\t#tgrtArtikelbildPlattformDel.kArtikel AS kOption1,\r\n\t\t\t\t#tgrtArtikelbildPlattformDel.nNr AS kOption2\r\n\t\t\tFROM #tgrtArtikelbildPlattformDel\r\n\t\t\tJOIN dbo.tArtikelShop ON tArtikelShop.kArtikel = #tgrtArtikelbildPlattformDel.kArtikel\r\n\t\t\t\tAND tArtikelShop.kShop = #tgrtArtikelbildPlattformDel.kShop\r\n\t\t\tWHERE #tgrtArtikelbildPlattformDel.nInsertQueueBlock = 1;\r\n\r\n\t\t--\r\n\t\t-- Artikelshop aktualisieren, um SCX Angebot erneut zu SCX zu senden, mit aktualisierter Bilderliste\r\n\t\t--\r\n\t\tUPDATE dbo.tArtikelShop\r\n\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\ttArtikelShop.cInet = 'Y'\r\n\t\tFROM dbo.tArtikelShop \r\n\t\tJOIN SCX.tOffer ON tOffer.kArtikel = tArtikelShop.kArtikel\r\n\t\t\tAND tOffer.kShop = tArtikelShop.kShop\r\n\t\tJOIN #tgrtArtikelbildPlattformDel ON #tgrtArtikelbildPlattformDel.kArtikel = tOffer.kArtikel\r\n\t\t\tAND #tgrtArtikelbildPlattformDel.kShop = tOffer.kShop\r\n\t\tWHERE #tgrtArtikelbildPlattformDel.nInsertQueueBlock = 1;\r\n\tEND\r\n\r\n\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformDel WHERE #tgrtArtikelbildPlattformDel.nEbayUpdateBlock = 1)\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- eBay aktualisieren\r\n\t\t--\r\n\t\tDECLARE @Artikel AS TYPE_spUpdateEbayBilderLaufendGeplant;\r\n\t\tINSERT INTO @Artikel (kArtikel)\r\n\t\t\tSELECT #tgrtArtikelbildPlattformDel.kArtikel\r\n\t\t\tFROM #tgrtArtikelbildPlattformDel\r\n\t\t\tWHERE #tgrtArtikelbildPlattformDel.nEbayUpdateBlock = 1\r\n\t\tEXEC dbo.spUpdateEbayBilderLaufendGeplant @Artikel;\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tArtikelbildPlattform",
|
|
"triggerName": "tgr_tArtikelbildPlattform_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tArtikelbildPlattform_INSUP]\r\nON [dbo].[tArtikelbildPlattform]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM INSERTED) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF (NOT (UPDATE(kBild) OR UPDATE(nNr) OR UPDATE(kPlattform) OR UPDATE(nInet) OR UPDATE(kArtikel) OR UPDATE(kShop)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtArtikelbildPlattformInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtArtikelbildPlattformInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtArtikelbildPlattformInsup\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkArtikelbildPlattform INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tnInetNeu INT NOT NULL,\r\n\t\tkPlattform INT NOT NULL,\r\n\t\tnNrNeu INT NOT NULL,\r\n\t\tnNrAlt INT NULL,\r\n\t\tkBildAlt INT NULL,\r\n\t\tkBildNeu INT NOT NULL,\r\n\t\tkShopAlt INT NULL,\r\n\t\tkPlattformAlt INT NULL,\r\n\t\tkArtikelbildPlattformAlt INT NULL,\r\n\t\tkArtikelAlt INT NULL,\r\n\t\tnBildNrBlock BIT NOT NULL,\r\n\t\tnInetBlock BIT NOT NULL,\r\n\t\tnEbayUpdateBlock BIT NOT NULL,\r\n\t\tnDeleteQueueBlock BIT NOT NULL,\r\n\t\tnInsertQueueBlock BIT NOT NULL,\r\n\t\tnUpload BIT NOT NULL,\r\n\t\tnNr BIT NOT NULL,\r\n\t\tnScxBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtArtikelbildPlattformInsup (kArtikel, kArtikelbildPlattform, kShop, nInetNeu, kPlattform, nNrNeu, nNrAlt, kBildAlt, kBildNeu, \r\n\t\t\t\t\t\t\t\t\t\t\t\tkShopAlt, kPlattformAlt, kArtikelbildPlattformAlt, kArtikelAlt, nBildNrBlock, nInetBlock, \r\n\t\t\t\t\t\t\t\t\t\t\t\tnEbayUpdateBlock, nDeleteQueueBlock, nInsertQueueBlock, nNr, nUpload, nScxBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tInserted.kArtikelbildPlattform,\r\n\t\t\tInserted.kShop,\r\n\t\t\tInserted.nInet,\r\n\t\t\tInserted.kPlattform,\r\n\t\t\tInserted.nNr,\r\n\t\t\tDeleted.nNr,\r\n\t\t\tDeleted.kBild,\r\n\t\t\tInserted.kBild,\r\n\t\t\tDeleted.kShop,\r\n\t\t\tDeleted.kPlattform,\r\n\t\t\tDeleted.kArtikelbildPlattform,\r\n\t\t\tDeleted.kArtikel,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kBild, Inserted.nNr EXCEPT SELECT Deleted.kBild, Deleted.nNr)\r\n\t\t\tTHEN 1 ELSE 0 END AS nBildNrBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nInet EXCEPT SELECT Deleted.nInet) \r\n\t\t\t\tAND Inserted.nInet = 1\r\n\t\t\tTHEN 1 ELSE 0 END AS nInetBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kPlattform, Inserted.nNr EXCEPT SELECT Deleted.kPlattform, Deleted.nNr)\r\n\t\t\t\tAND (Deleted.kPlattform = 30\r\n\t\t\t\tAND Deleted.nNr <= 12\r\n\t\t\t\tOR Inserted.kPlattform = 30\r\n\t\t\t\tAND Inserted.nNr <= 12)\r\n\t\t\tTHEN 1 ELSE 0 END AS nEbayUpdateBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nInet, Inserted.nNr EXCEPT SELECT Deleted.nInet, Deleted.nNr)\r\n\t\t\t\tAND Inserted.nInet = 1\r\n\t\t\tTHEN 1 ELSE 0 END AS nDeleteQueueBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nNr EXCEPT SELECT Deleted.nNr)\r\n\t\t\t\tAND Deleted.nNr < 1000000000\r\n\t\t\t\tAND Deleted.kPlattform = 2\r\n\t\t\tTHEN 1 ELSE 0 END AS nInsertQueueBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nNr EXCEPT SELECT Deleted.nNr) THEN 1 ELSE 0 END AS nNr,\r\n\t\t\tIIF(Inserted.kShop > 0, 1, 0) AS nUpload,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nNr, Inserted.kBild, Inserted.kShop, Inserted.nInet \r\n\t\t\t\t\tEXCEPT SELECT Deleted.nNr, Deleted.kBild, Deleted.kShop, Deleted.nInet)\r\n\t\t\t\tTHEN 1 ELSE 0 END AS nScxBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kArtikelbildPlattform = Inserted.kArtikelbildPlattform\r\n\r\n\r\n\tIF(UPDATE(nNr) OR UPDATE(kBild))\r\n\tBEGIN \r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nBildNrBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtArtikelbildPlattformInsup ON #tgrtArtikelbildPlattformInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nBildNrBlock = 1;\r\n\t\t\t--\r\n\t\t\t-- Artikelbeschreibung\r\n\t\t\t--\r\n\t\t\t--\r\n\t\t\t-- Wenn sich das Bild oder die Sortierug geaendert hat muss der Eintrag neu an den Shop uebertragen werden\r\n\t\t\t--\r\n\t\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nUpload = 1)\r\n\t\t\tBEGIN\r\n\t\t\t\tUPDATE dbo.tArtikelbildPlattform\r\n\t\t\t\tSET tArtikelbildPlattform.nInet = 1\r\n\t\t\t\tFROM dbo.tArtikelbildPlattform\r\n\t\t\t\tJOIN #tgrtArtikelbildPlattformInsup ON #tgrtArtikelbildPlattformInsup.kArtikelbildPlattform = tArtikelbildPlattform.kArtikelbildPlattform\r\n\t\t\t\tJOIN dbo.tArtikelShop ON tArtikelShop.kArtikel = tArtikelbildPlattform.kArtikel \r\n\t\t\t\t\tAND tArtikelShop.kShop = tArtikelbildPlattform.kShop\r\n\t\t\t\tWHERE #tgrtArtikelbildPlattformInsup.nBildNrBlock = 1\r\n\t\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nUpload = 1;\r\n\t\t\tEND\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF (UPDATE(nNr))\r\n\tBEGIN\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nEbayUpdateBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Ebay\r\n\t\t\t--\r\n\t\t\tDECLARE @Artikel AS TYPE_spUpdateEbayBilderLaufendGeplant;\r\n\t\t\tINSERT INTO @Artikel (kArtikel)\r\n\t\t\t\tSELECT #tgrtArtikelbildPlattformInsup.kArtikel\r\n\t\t\t\tFROM #tgrtArtikelbildPlattformInsup\r\n\t\t\t\tWHERE #tgrtArtikelbildPlattformInsup.nEbayUpdateBlock = 1\r\n\t\t\tEXEC dbo.spUpdateEbayBilderLaufendGeplant @Artikel;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nInsertQueueBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Wenn sich die nNr tBild.cHash geaendert hat tQueue-Loescheintrag fuer Quell-nNr und Ziel-nNr anlegen\r\n\t\t\t--\r\n\t\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2)\r\n\t\t\tSELECT \r\n\t\t\t\t#tgrtArtikelbildPlattformInsup.kShopAlt,\r\n\t\t\t\t#tgrtArtikelbildPlattformInsup.kPlattformAlt,\r\n\t\t\t\t'tArtikelbildPlattform' AS cName,\r\n\t\t\t\t#tgrtArtikelbildPlattformInsup.kArtikelbildPlattformAlt AS kWert,\r\n\t\t\t\t2 AS nAction,\r\n\t\t\t\t#tgrtArtikelbildPlattformInsup.kArtikelAlt AS kOption1, \r\n\t\t\t\t#tgrtArtikelbildPlattformInsup.nNrAlt AS kOption2\r\n\t\t\tFROM #tgrtArtikelbildPlattformInsup\r\n\t\t\tJOIN dbo.tBild AS bildDeleted ON bildDeleted.kBild = #tgrtArtikelbildPlattformInsup.kBildAlt\r\n\t\t\tJOIN dbo.tBild AS bildInserted ON bildInserted.kBild = #tgrtArtikelbildPlattformInsup.kBildNeu\r\n\t\t\tWHERE (#tgrtArtikelbildPlattformInsup.nNrNeu != #tgrtArtikelbildPlattformInsup.nNrAlt\r\n\t\t\t\tOR bildDeleted.cHash != bildInserted.cHash) \r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nInsertQueueBlock = 1\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF (UPDATE(nInet))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nInetBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Artikelbeschreibung\r\n\t\t\t--\r\n\t\t\t--\r\n\t\t\t-- nInet auf 0 setzen wenn Artikel gar nicht für Shop aktiv\r\n\t\t\t--\r\n\t\t\tUPDATE tArtikelbildPlattform\r\n\t\t\tSET tArtikelbildPlattform.nInet = 0\r\n\t\t\tFROM dbo.tArtikelbildPlattform\r\n\t\t\tJOIN #tgrtArtikelbildPlattformInsup ON #tgrtArtikelbildPlattformInsup.kArtikelbildPlattform = dbo.tArtikelbildPlattform.kArtikelbildPlattform\r\n\t\t\tLEFT JOIN dbo.tArtikelShop ON #tgrtArtikelbildPlattformInsup.kArtikel = tArtikelShop.kArtikel\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.kShop = tArtikelShop.kShop\r\n\t\t\tWHERE tArtikelShop.kArtikel IS NULL\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nInetBlock = 1;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nDeleteQueueBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Connector\r\n\t\t\t--\r\n\t\t\tDELETE dbo.tQueue\r\n\t\t\tFROM dbo.tQueue\r\n\t\t\tJOIN #tgrtArtikelbildPlattformInsup ON tQueue.kShop = #tgrtArtikelbildPlattformInsup.kShop\r\n\t\t\t\tAND tQueue.kOption1 = #tgrtArtikelbildPlattformInsup.kArtikel\r\n\t\t\tJOIN dbo.tShop ON tShop.kShop = #tgrtArtikelbildPlattformInsup.kShop\r\n\t\t\t\tAND tShop.nTyp = 0\r\n\t\t\tWHERE tQueue.cName = 'tArtikelbildPlattform'\r\n\t\t\t\tAND tQueue.nAction = 2\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nNrNeu = tQueue.kOption2\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.nDeleteQueueBlock = 1\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF (UPDATE(nNr) OR UPDATE(kBild) OR UPDATE(nInet) OR UPDATE(kShop))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtArtikelbildPlattformInsup WHERE #tgrtArtikelbildPlattformInsup.nScxBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nAktion = tArtikelShop.nAktion | 1\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN SCX.tOffer ON tOffer.kArtikel = tArtikelShop.kArtikel\r\n\t\t\t\tAND tOffer.kShop = tArtikelShop.kShop\r\n\t\t\tJOIN #tgrtArtikelbildPlattformInsup ON #tgrtArtikelbildPlattformInsup.kArtikel = tOffer.kArtikel\r\n\t\t\t\tAND #tgrtArtikelbildPlattformInsup.kShop = tOffer.kShop\r\n\t\t\tWHERE #tgrtArtikelbildPlattformInsup.nScxBlock = 1\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttribut",
|
|
"triggerName": "jtlActionValidator_tAttribut",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tAttribut] \r\nON [dbo].[tAttribut] \r\nAFTER DELETE \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN \r\n\r\n\t--\r\n\t--Überprüfen ob Trigger mit Inhalt aufgerufen wird\r\n\t--\r\n\t\tIF((SELECT COUNT(1) FROM DELETED) = 0)\r\n\t\tBEGIN\r\n\t\t\tRETURN\r\n\t\tEND\r\n\r\n\t--\r\n\t-- tAttributSprache aufräumen\r\n\t--\r\n\t\tDELETE tAttributSprache WITH(ROWLOCK)\r\n\t\tFROM tAttributSprache WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kAttribut = tAttributSprache.kAttribut \r\n \r\n\r\n \t--\r\n\t-- tArtikelAttribut aufräumen\r\n\t--\r\n\t\tDELETE tArtikelAttribut WITH(ROWLOCK)\r\n\t\tFROM tArtikelAttribut WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kAttribut = tArtikelAttribut.kAttribut\r\n\r\n\t--\r\n\t-- tKategorieAttribut aufräumen\r\n\t--\r\n\t\tDELETE tKategorieAttribut WITH(ROWLOCK)\r\n\t\tFROM tKategorieAttribut WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kAttribut = tKategorieAttribut.kAttribut\r\n\t\t\r\n\t--\r\n\t-- tWawiAttribut aufräumen\r\n\t--\r\n\t\tDELETE tWawiAttribut WITH(ROWLOCK)\r\n\t\tFROM tWawiAttribut WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kAttribut = tWawiAttribut.kAttribut\r\n\t\t\t\r\n \t--\r\n\t-- tAttributShop aufräumen\r\n\t--\r\n\t\tDELETE tAttributShop WITH(ROWLOCK)\r\n\t\tFROM tAttributShop WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kAttribut = tAttributShop.kAttribut\r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttribut",
|
|
"triggerName": "tgr_tAttribut_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tAttribut_DEL]\r\nON [dbo].[tAttribut]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtAttributDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtAttributDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtAttributDel\r\n\t(\r\n\t\tkAttribut INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tnIstFreifeld TINYINT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtAttributDel (kAttribut, kArtikel, nIstFreifeld)\r\n\t\tSELECT\r\n\t\t\tDeleted.kAttribut,\r\n\t\t\ttArtikelAttribut.kArtikel,\r\n\t\t\tDeleted.nIstFreifeld\r\n\t\tFROM Deleted\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kAttribut = Deleted.kAttribut\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Falls ein eigenes Feld gelöscht wird, funktioniert die Löschweitergabe nicht sauber\r\n\t-- da das Attribut mit der Information ob es ein Eigenes Feld ist bereits gelöscht ist\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\t\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel\r\n\tJOIN #tgrtAttributDel ON #tgrtAttributDel.kAttribut = tArtikelAttribut.kAttribut\r\n\tWHERE #tgrtAttributDel.nIstFreifeld = 1 \r\n\t\tAND (tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1);\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtAttributDel ON #tgrtAttributDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttribut",
|
|
"triggerName": "tgr_tAttribut_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tAttribut_INSUP]\r\nON [dbo].[tAttribut]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM INSERTED) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF (NOT (UPDATE(nSortierung) OR UPDATE(kFeldTyp) OR UPDATE(cGruppeName)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM \r\n\t(\r\n\t\tSELECT\r\n\t\t\ttArtikelAttribut.kArtikel\r\n\t\tFROM Inserted\r\n\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kAttribut = Inserted.kAttribut\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kAttribut = Inserted.kAttribut\r\n\t\tWHERE EXISTS\r\n\t\t(\r\n\t\t\tSELECT\tInserted.nSortierung, Inserted.kFeldTyp, Inserted.cGruppeName\r\n\t\t\tEXCEPT\r\n\t\t\tSELECT\tDeleted.nSortierung, Deleted.kFeldTyp, Deleted.cGruppeName\r\n\t\t)\t\t\t\r\n\t) AS Diff \r\n\tWHERE tEntityTracking.kEntityId = Diff.kArtikel\r\n\t\tAND tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttributSprache",
|
|
"triggerName": "tgr_tAttributSprache_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tAttributSprache_DEL]\r\nON [dbo].[tAttributSprache]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtAttributSpracheDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtAttributSpracheDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtAttributSpracheDel\r\n\t(\r\n\t\tkAttribut INT NOT NULL,\r\n\t\tkSprache INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtAttributSpracheDel (kAttribut, kSprache)\r\n\t\tSELECT\r\n\t\t\tDeleted.kAttribut,\r\n\t\t\tDeleted.kSprache\r\n\t\tFROM Deleted;\r\n\t\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tEntityTracking.kEntityId\r\n\t\tAND tEntityTracking.nEntityType = 1\r\n\t\tAND tEntityTracking.nSyncType = 4\r\n\tJOIN #tgrtAttributSpracheDel ON #tgrtAttributSpracheDel.kAttribut = tArtikelAttribut.kAttribut;\r\n\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel \r\n\t\tAND tArtikelAttribut.kShop = 0\r\n\tJOIN #tgrtAttributSpracheDel ON #tgrtAttributSpracheDel.kAttribut = tArtikelAttribut.kAttribut\r\n\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tArtikelAttribut.kAttribut \r\n\t\tAND tAttributShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\r\n\t--\r\n\t-- Kategorie vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tKategorieShop\r\n\tSET tKategorieShop.cInet = 'Y'\r\n\tFROM dbo.tKategorieShop\r\n\tJOIN dbo.tKategorieAttribut ON tKategorieAttribut.kKategorie = tKategorieShop.kKategorie \r\n\t\tAND dbo.tKategorieAttribut.kShop = 0\r\n\tJOIN #tgrtAttributSpracheDel ON #tgrtAttributSpracheDel.kAttribut = tKategorieAttribut.kAttribut\r\n\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tKategorieAttribut.kAttribut \r\n\t\tAND tKategorieShop.kShop = tAttributShop.kShop\r\n\tWHERE tKategorieShop.cInet = 'N';\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tAttributSprache",
|
|
"triggerName": "tgr_tAttributSprache_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tAttributSprache_INSUP]\r\nON [dbo].[tAttributSprache]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtAttributSpracheInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtAttributSpracheInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtAttributSpracheInsup\r\n\t(\r\n\t\tkAttribut INT NOT NULL,\r\n\t\tkSprache INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtAttributSpracheInsup (kAttribut, kSprache, nPosBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kAttribut,\r\n\t\t\tInserted.kSprache,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cName EXCEPT SELECT Deleted.cName) THEN 1 ELSE 0 END AS nPosBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kAttribut = Inserted.kAttribut\r\n\t\t\tAND Deleted.kSprache = Inserted.kSprache\r\n\r\n\tIF(UPDATE(cName))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtAttributSpracheInsup WHERE #tgrtAttributSpracheInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tEntityTracking.kEntityId\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\t\tJOIN #tgrtAttributSpracheInsup ON #tgrtAttributSpracheInsup.kAttribut = tArtikelAttribut.kAttribut\r\n\t\t\tWHERE #tgrtAttributSpracheInsup.nPosBlock = 1;\r\n\t\tEND\r\n\tEND\r\n\t\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN dbo.tArtikelAttribut ON tArtikelAttribut.kArtikel = tArtikelShop.kArtikel \r\n\t\tAND tArtikelAttribut.kShop = 0\r\n\tJOIN #tgrtAttributSpracheInsup ON #tgrtAttributSpracheInsup.kAttribut = tArtikelAttribut.kAttribut\r\n\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tArtikelAttribut.kAttribut \r\n\t\tAND tAttributShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\r\n\t--\r\n\t-- Kategorie vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tKategorieShop\r\n\tSET tKategorieShop.cInet = 'Y'\r\n\tFROM dbo.tKategorieShop\r\n\tJOIN dbo.tKategorieAttribut ON tKategorieAttribut.kKategorie = tKategorieShop.kKategorie \r\n\t\tAND dbo.tKategorieAttribut.kShop = 0\r\n\tJOIN #tgrtAttributSpracheInsup ON #tgrtAttributSpracheInsup.kAttribut = tKategorieAttribut.kAttribut\r\n\tJOIN dbo.tAttributShop ON tAttributShop.kAttribut = tKategorieAttribut.kAttribut \r\n\t\tAND tKategorieShop.kShop = tAttributShop.kShop\r\n\tWHERE tKategorieShop.cInet = 'N';\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tBild",
|
|
"triggerName": "tgr_tBild_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tBild_DEL]\r\nON [dbo].[tBild]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtBildDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtBildDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtBildDel\r\n\t(\r\n\t\tkBild INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtBildDel (kBild)\r\n\t\tSELECT\r\n\t\t\tDeleted.kBild\r\n\t\tFROM Deleted;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN dbo.tArtikelbildPlattform ON tArtikelbildPlattform.kArtikel = tEntityTracking.kEntityId\r\n\t\tAND tArtikelbildPlattform.nNr = 1\r\n\t\tAND tArtikelbildPlattform.kPlattform = 1\r\n\tJOIN #tgrtBildDel ON #tgrtBildDel.kBild = tArtikelbildPlattform.kBild;\r\n\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN dbo.tKategoriebildPlattform ON tKategoriebildPlattform.kKategorie = tEntityTracking.kEntityId\r\n\t\tAND tKategoriebildPlattform.nNr = 1\r\n\t\tAND tKategoriebildPlattform.kPlattform = 1\r\n\tJOIN #tgrtBildDel ON #tgrtBildDel.kBild = tKategoriebildPlattform.kBild;\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n -- tArtikelbildPlattform\r\n --\r\n DELETE dbo.tArtikelbildPlattform\r\n FROM dbo.tArtikelbildPlattform\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tArtikelbildPlattform.kBild\r\n WHERE tArtikelbildPlattform.kBild = #tgrtBildDel.kBild;\r\n\r\n --\r\n -- tKategoriebildPlattform\r\n --\r\n DELETE dbo.tKategoriebildPlattform\r\n FROM dbo.tKategoriebildPlattform\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tKategoriebildPlattform.kBild\r\n WHERE tKategoriebildPlattform.kBild = #tgrtBildDel.kBild;\r\n\r\n --\r\n -- tEigenschaftWertPict\r\n --\r\n DELETE dbo.tEigenschaftWertPict\r\n FROM dbo.tEigenschaftWertPict\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tEigenschaftWertPict.kBild\r\n WHERE tEigenschaftWertPict.kBild = #tgrtBildDel.kBild;\r\n\r\n --\r\n -- tMerkmalBildPlattform\r\n --\r\n DELETE dbo.tMerkmalBildPlattform\r\n FROM dbo.tMerkmalBildPlattform\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tMerkmalBildPlattform.kBild\r\n WHERE tMerkmalBildPlattform.kBild = #tgrtBildDel.kBild;\r\n\r\n --\r\n -- tMerkmalwertBildPlattform\r\n --\r\n DELETE dbo.tMerkmalwertBildPlattform\r\n FROM dbo.tMerkmalwertBildPlattform\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tMerkmalwertBildPlattform.kBild\r\n WHERE tMerkmalwertBildPlattform.kBild = #tgrtBildDel.kBild;\r\n\r\n --\r\n -- tHerstellerBild\r\n --\r\n DELETE dbo.tHerstellerBildPlattform\r\n FROM dbo.tHerstellerBildPlattform\r\n JOIN #tgrtBildDel ON #tgrtBildDel.kBild = tHerstellerBildPlattform.kBild\r\n WHERE tHerstellerBildPlattform.kBild = #tgrtBildDel.kBild;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tBild",
|
|
"triggerName": "tgr_tBild_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tBild_INSUP]\r\nON [dbo].[tBild]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF (NOT (UPDATE(cHash) OR UPDATE(cQuelle)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtBildInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtBildInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtBildInsup\r\n\t(\r\n\t\tkBild INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnUpdateBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtBildInsup (kBild, nPosBlock, nUpdateBlock)\r\n\t\tSELECT \r\n\t\t\tInserted.kBild,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cHash, Inserted.cQuelle EXCEPT SELECT Deleted.cHash, Deleted.cQuelle)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cHash EXCEPT SELECT Deleted.cHash) THEN 1 ELSE 0 END AS nUpdateBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kBild = Inserted.kBild;\r\n\r\n\tIF(UPDATE(cHash) OR UPDATE(cQuelle))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtBildInsup WHERE #tgrtBildInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN dbo.tArtikelbildPlattform ON tArtikelbildPlattform.kArtikel = tEntityTracking.kEntityId\r\n\t\t\t\tAND tArtikelbildPlattform.nNr = 1\r\n\t\t\t\tAND tArtikelbildPlattform.kPlattform = 1\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tArtikelbildPlattform.kBild\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND #tgrtBildInsup.nPosBlock = 1\r\n\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN dbo.tKategoriebildPlattform ON tKategoriebildPlattform.kKategorie = tEntityTracking.kEntityId\r\n\t\t\t\tAND tKategoriebildPlattform.nNr = 1\r\n\t\t\t\tAND tKategoriebildPlattform.kPlattform = 1\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tKategoriebildPlattform.kBild\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 2\r\n\t\t\t\tAND #tgrtBildInsup.nPosBlock = 1\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF(UPDATE(cHash))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtBildInsup WHERE #tgrtBildInsup.nUpdateBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Connector\r\n\t\t\t--\r\n\t\t\t--\r\n\t\t\t-- tArtikelbildPlattform\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelbildPlattform\r\n\t\t\tSET tArtikelbildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tArtikelbildPlattform\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tArtikelbildPlattform.kBild\r\n\t\t\tWHERE tArtikelbildPlattform.kBild = #tgrtBildInsup.kBild \r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\tAND (tArtikelbildPlattform.kShop > 0 \r\n\t\t\t\t\tOR tArtikelbildPlattform.kPlattform IN (2, 30));\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- tKategoriebildPlattform\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tKategoriebildPlattform\r\n\t\t\tSET tKategoriebildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tKategoriebildPlattform\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tKategoriebildPlattform.kBild\r\n\t\t\tWHERE tKategoriebildPlattform.kBild = #tgrtBildInsup.kBild \r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\tAND (tKategoriebildPlattform.kShop > 0 \r\n\t\t\t\t\tOR tKategoriebildPlattform.kPlattform IN (2, 30));\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- tEigenschaftWertPict\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tEigenschaftWertPict\r\n\t\t\tSET tEigenschaftWertPict.nInet = 1\r\n\t\t\tFROM dbo.tEigenschaftWertPict\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tEigenschaftWertPict.kBild\r\n\t\t\tWHERE tEigenschaftWertPict.kBild = #tgrtBildInsup.kBild\r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\t\t\t\r\n\t\t\t\tAND (dbo.tEigenschaftWertPict.kShop > 0 \r\n\t\t\t\t\tOR dbo.tEigenschaftWertPict.kPlattform IN (2, 30));\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- tMerkmalBild\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tMerkmalBildPlattform\r\n\t\t\tSET tMerkmalBildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tMerkmalBildPlattform\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tMerkmalBildPlattform.kBild\r\n\t\t\tWHERE tMerkmalBildPlattform.kBild = #tgrtBildInsup.kBild \r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\tAND (tMerkmalBildPlattform.kShop > 0 \r\n\t\t\t\t\tOR tMerkmalBildPlattform.kPlattform IN (2, 30));\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- tMerkmalWertBild\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tMerkmalwertBildPlattform\r\n\t\t\tSET tMerkmalwertBildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tMerkmalwertBildPlattform\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tMerkmalwertBildPlattform.kBild\r\n\t\t\tWHERE tMerkmalwertBildPlattform.kBild = #tgrtBildInsup.kBild \r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\tAND (tMerkmalwertBildPlattform.kShop > 0 \r\n\t\t\t\t\tOR tMerkmalwertBildPlattform.kPlattform IN (2, 30));\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- tHerstellerBild\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tHerstellerBildPlattform\r\n\t\t\tSET dbo.tHerstellerBildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tHerstellerBildPlattform\r\n\t\t\tJOIN #tgrtBildInsup ON #tgrtBildInsup.kBild = tHerstellerBildPlattform.kBild\r\n\t\t\tJOIN INSERTED ON INSERTED.kBild = dbo.tHerstellerBildPlattform.kBild\r\n\t\t\tWHERE tHerstellerBildPlattform.kBild = #tgrtBildInsup.kBild\r\n\t\t\t\tAND #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\tAND (tHerstellerBildPlattform.kShop > 0\r\n\t\t\t\t\tOR tHerstellerBildPlattform.kPlattform IN (2, 30));\r\n\r\n\t\t\tMERGE INTO dbo.tQueue\r\n\t\t\tUSING (SELECT\r\n\t\t\t\t\ttArtikelbildPlattform.kShop,\r\n\t\t\t\t\ttArtikelbildPlattform.kPlattform,\r\n\t\t\t\t\t'tArtikelbildPlattform' AS cName,\r\n\t\t\t\t\ttArtikelbildPlattform.kArtikelbildPlattform,\r\n\t\t\t\t\ttArtikelbildPlattform.kArtikel,\r\n\t\t\t\t\ttArtikelbildPlattform.nNr,\r\n\t\t\t\t\t2 AS nAction\r\n\t\t\t\tFROM #tgrtBildInsup\r\n\t\t\t\tJOIN dbo.tArtikelbildPlattform ON tArtikelbildPlattform.kBild = #tgrtBildInsup.kBild\r\n\t\t\t\tWHERE #tgrtBildInsup.nUpdateBlock = 1\r\n\t\t\t\t\tAND (tArtikelbildPlattform.kShop > 0 \r\n\t\t\t\t\t\tOR tArtikelbildPlattform.kPlattform IN (2, 30))) AS Quelle\r\n\t\t\t\tON tQueue.kWert = Quelle.kArtikelbildPlattform\r\n\t\t\t\t\tAND tQueue.kOption1 = Quelle.kArtikel\r\n\t\t\t\t\tAND tQueue.kOption2 = Quelle.nNr\r\n\t\t\t\t\tAND tQueue.cName = Quelle.cName\r\n\t\t\t\t\tAND tQueue.kShop = Quelle.kShop\r\n\t\t\tWHEN NOT MATCHED BY TARGET THEN\r\n\t\t\t\tINSERT (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2)\r\n\t\t\t\t\tVALUES (Quelle.kShop, Quelle.kPlattform, Quelle.cName, Quelle.kArtikelbildPlattform, Quelle.nAction, Quelle.kArtikel, Quelle.nNr);\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"triggerName": "jtlActionValidator_tkategorie",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tkategorie] \r\nON [dbo].[tkategorie]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN\r\n IF NOT EXISTS(SELECT * FROM DELETED)\r\n BEGIN \r\n\t RETURN;\r\n END;\r\n DECLARE @Cinfo VARBINARY(128); \r\n SELECT @Cinfo = Context_Info(); \r\n IF @Cinfo = 0x55555\r\n BEGIN\r\n\t RETURN;\r\n END; \r\n IF(OBJECT_ID('tempdb..#Kategorie') IS NOT NULL)\r\n BEGIN\t \r\n\t DROP TABLE #Kategorie;\r\n END;\r\n\r\n --\r\n -- Kategoriebaum erzeugen\r\n --\r\n IF(OBJECT_ID('tempdb..#KategorieBaum') IS NOT NULL)\r\n BEGIN\t \r\n\t DROP TABLE #KategorieBaum;\r\n END;\r\n WITH KategorieBaum AS (\r\n\t SELECT t.kKategorie, t.kOberKategorie \r\n\t\t FROM DELETED AS t\r\n\t UNION ALL\r\n\t SELECT t.kKategorie, t.kOberKategorie \r\n\t\t FROM dbo.tkategorie AS t \r\n\t\t INNER JOIN KategorieBaum AS r ON t.kOberKategorie = r.kKategorie\r\n )\r\n SELECT kKategorie INTO #KategorieBaum \r\n\t FROM KategorieBaum;\r\n --\r\n -- Löschen der zugehörigen Einträge\r\n --\r\n\r\n -- KategorieBilder\r\n DELETE tKategoriebildPlattform\r\n\t FROM tKategoriebildPlattform\r\n\t JOIN #KategorieBaum ON tKategoriebildPlattform.kKategorie = #KategorieBaum.kKategorie;\r\n\r\n -- Attribute\r\n DELETE tKategorieAttribut\r\n\t FROM tKategorieAttribut\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieAttribut.kKategorie;\r\n\t \r\n -- Rabatt\r\n DELETE tKategorieRabatt\r\n\t FROM tKategorieRabatt\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieRabatt.kKategorie;\r\n\r\n -- Sichtbarkeit\r\n DELETE tKategorieSichtbarkeit\r\n\t FROM tKategorieSichtbarkeit\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieSichtbarkeit.kKategorie;\r\n\r\n -- Sprache\r\n DELETE tKategorieSprache\r\n\t FROM tKategorieSprache\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieSprache.kKategorie;\r\n\r\n\t--\r\n\t-- Evtl. bestehende Queue leeren (z.B. falls Aktualisierung im Shop vorgesehen war)\r\n\t--\r\n\tDELETE dbo.tQueue\r\n\t\tFROM dbo.tQueue\r\n\t\tJOIN DELETED ON dbo.tQueue.kWert = DELETED.kKategorie \r\n\t\t\t\t\tAND dbo.tQueue.cName = 'tkategorie';\r\n\r\n INSERT INTO tQueue(kShop, kPlattform, cName, kWert, nAction)\t \r\n\t SELECT tKategorieShop.kShop, 0,'tArtikel' AS cName, #KategorieBaum.kKategorie, 2\r\n\t\t FROM #KategorieBaum\r\n\t\t JOIN tKategorieShop ON #KategorieBaum.kKategorie = tKategorieShop.kKategorie\r\n\t\t JOIN tkategorieartikel ON tkategorieartikel.kKategorie = #KategorieBaum.kKategorie\r\n\t\t JOIN tArtikelShop ON tArtikelShop.kArtikel = tkategorieartikel.kArtikel \r\n\t\t\t AND tArtikelShop.kShop = tKategorieShop.kShop\r\n\t\t\t WHERE NOT EXISTS\r\n\t\t (\r\n\t\t\t SELECT tkategorie.kKategorie FROM tkategorie\r\n\t\t\t JOIN tKategorieShop ON #KategorieBaum.kKategorie = tKategorieShop.kKategorie\r\n\t\t\t JOIN tkategorieartikel ON tkategorieartikel.kKategorie = #KategorieBaum.kKategorie\r\n\t\t\t JOIN tArtikelShop ON tArtikelShop.kArtikel = tkategorieartikel.kArtikel \r\n\t\t\t\tAND tArtikelShop.kShop = tKategorieShop.kShop\r\n\t\t\t WHERE tKategorie.kKategorie NOT IN (SELECT kKategorie FROM #KategorieBaum)\r\n\t\t )\t\r\n\r\n -- KategorieShop\r\n DELETE tKategorieShop\r\n\t FROM tKategorieShop\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieShop.kKategorie;\r\n\t \r\n\r\n -- KategorieArtikel\r\n DELETE tKategorieArtikel\r\n\t FROM tKategorieArtikel\r\n\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tKategorieArtikel.kKategorie;\r\n\r\n\tUPDATE dbo.tShop\r\n\t\tSET dbo.tShop.kKategorie = 0\r\n\tFROM dbo.tShop\r\n\tJOIN DELETED ON dbo.tShop.kKategorie = DELETED.kKategorie;\r\n\r\n -- Kategorie löschen\r\n BEGIN TRANSACTION\r\n\t SET CONTEXT_INFO 0x55555;\r\n\t DELETE tkategorie\r\n\t\t FROM tkategorie\r\n\t\t JOIN #KategorieBaum ON #KategorieBaum.kKategorie = tkategorie.kKategorie;\r\n COMMIT;\t\t \r\nEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"triggerName": "tgr_tkategorie_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tkategorie_DEL]\r\nON [dbo].[tkategorie]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tUPDATE Sync.tEntityPlatform\r\n\tSET tEntityPlatform.dInactive = GETDATE()\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN Deleted ON Deleted.kKategorie = tEntityPlatform.kEntityId\r\n\tWHERE tEntityPlatform.nEntityType = 2;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorie",
|
|
"triggerName": "tgr_tkategorie_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tkategorie_INSUP]\r\nON [dbo].[tkategorie]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (NOT (UPDATE(nSort) OR UPDATE(kOberKategorie)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtkategorieInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtkategorieInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtkategorieInsup\r\n\t(\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnConnectorBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtkategorieInsup (kKategorie, nPosBlock, nConnectorBlock)\r\n\t\tSELECT \r\n\t\t\tInserted.kKategorie,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nSort, Inserted.kOberKategorie EXCEPT SELECT Deleted.nSort, Deleted.kOberKategorie)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kOberKategorie EXCEPT SELECT Deleted.kOberKategorie) \r\n\t\t\t\tAND Deleted.kKategorie IS NOT NULL\r\n\t\t\tTHEN 1 ELSE 0 END AS nConnectorBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKategorie = Inserted.kKategorie;\r\n\r\n\tIF (UPDATE(nSort) OR UPDATE(kOberKategorie))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtkategorieInsup WHERE #tgrtkategorieInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtkategorieInsup ON #tgrtkategorieInsup.kKategorie = tEntityTracking.kEntityId\r\n\t\t\tWHERE #tgrtkategorieInsup.nPosBlock = 1\r\n\t\t\t\tAND tEntityTracking.nEntityType = 2\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF (UPDATE(kOberKategorie))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- Connector\r\n\t\t--\r\n\t\tIF EXISTS(SELECT 1 FROM #tgrtkategorieInsup WHERE #tgrtkategorieInsup.nConnectorBlock = 1)\r\n\t\tBEGIN\r\n \tUPDATE dbo.tKategorieShop\r\n\t\t\tSET tKategorieShop.cInet = 'Y'\r\n\t\t\tFROM dbo.tKategorieShop\r\n\t\t\tJOIN #tgrtkategorieInsup ON #tgrtkategorieInsup.kKategorie = tKategorieShop.kKategorie\r\n\t\t\tWHERE dbo.tKategorieShop.cInet <> 'Y'\r\n\t\t\t\tAND #tgrtkategorieInsup.nConnectorBlock = 1;\r\n\r\n\t\t\t--\r\n\t\t\t-- POS - Kategorie wird aus Wurzelkategoriebaum entfernt und darf nicht mehr zur POS gesendet werden\r\n\t\t\t--\r\n\t\t\tIF (OBJECT_ID('tempdb..#KategorieToDeleteInPos') IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #KategorieToDeleteInPos;\r\n\t\t\tEND\r\n\r\n\t\t\tIF (OBJECT_ID('tempdb..#KategorieToUpdateInPos') IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #KategorieToUpdateInPos;\r\n\t\t\tEND\r\n\r\n\t\t\tIF (OBJECT_ID('tempdb..#KategoriebaumPos') IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #KategoriebaumPos;\r\n\t\t\tEND\r\n\r\n\t\t\tIF (OBJECT_ID('tempdb..#KategorieShopPos') IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #KategorieShopPos;\r\n\t\t\tEND\r\n\r\n\t\t\tCREATE TABLE #KategorieToDeleteInPos\r\n\t\t\t(\r\n\t\t\t\tkKategorie INT,\r\n\t\t\t\tkShop INT\r\n\t\t\t);\r\n\r\n\t\t\tCREATE TABLE #KategorieToUpdateInPos\r\n\t\t\t(\r\n\t\t\t\tkKategorie INT,\r\n\t\t\t\tkShop INT\r\n\t\t\t);\r\n\r\n\t\t\tCREATE TABLE #KategoriebaumPos\r\n\t\t\t(\r\n\t\t\t\tkKategorie INT,\r\n\t\t\t\tkShop INT\r\n\t\t\t);\r\n\r\n\t\t\tCREATE TABLE #KategorieShopPos\r\n\t\t\t(\r\n\t\t\t\tkKategorie INT,\r\n\t\t\t\tkShop INT\r\n\t\t\t);\r\n\r\n\t\t\tINSERT INTO #KategoriebaumPos (kKategorie, kShop)\r\n\t\t\t\tSELECT DISTINCT\r\n\t\t\t\t\tifKategoriebaum.kKategorie,\r\n\t\t\t\t\tShops.kShop\r\n\t\t\t\tFROM \r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT DISTINCT\r\n\t\t\t\t\t\ttShop.kShop\r\n\t\t\t\t\tFROM #tgrtkategorieInsup\r\n\t\t\t\t\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = #tgrtkategorieInsup.kKategorie\r\n\t\t\t\t\tJOIN dbo.tShop ON tShop.kShop = tKategorieShop.kShop\r\n\t\t\t\t\tWHERE tShop.nTyp = 4\r\n\t\t\t\t\t\tAND #tgrtkategorieInsup.nConnectorBlock = 1\r\n\t\t\t\t) AS Shops\r\n\t\t\t\tCROSS APPLY Pos.ifKategoriebaum(Shops.kShop);\r\n\r\n\t\t\tINSERT INTO #KategorieShopPos (kKategorie, kShop)\r\n\t\t\t\tSELECT DISTINCT\r\n\t\t\t\t\t#tgrtkategorieInsup.kKategorie,\r\n\t\t\t\t\ttShop.kShop\r\n\t\t\t\tFROM #tgrtkategorieInsup\r\n\t\t\t\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = #tgrtkategorieInsup.kKategorie\r\n\t\t\t\tJOIN dbo.tShop ON tShop.kShop = tKategorieShop.kShop;\r\n\r\n\t\t\tINSERT INTO #KategorieToDeleteInPos (kKategorie, kShop)\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tifKategoriebaum.kKategorie,\r\n\t\t\t\t\tKategorien.kShop\r\n\t\t\t\tFROM \r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t#KategorieShopPos.kKategorie,\r\n\t\t\t\t\t\t#KategorieShopPos.kShop\r\n\t\t\t\t\tFROM #KategorieShopPos\r\n\t\t\t\t\tEXCEPT\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t#KategoriebaumPos.kKategorie,\r\n\t\t\t\t\t\t#KategoriebaumPos.kShop\r\n\t\t\t\t\tFROM #KategoriebaumPos\r\n\t\t\t\t) AS Kategorien\r\n\t\t\t\tCROSS APPLY dbo.ifKategoriebaum(Kategorien.kKategorie);\r\n\t\t\t\r\n\t\t\tINSERT INTO #KategorieToUpdateInPos (kKategorie, kShop)\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tifKategoriebaum.kKategorie,\r\n\t\t\t\t\tKategorien.kShop\r\n\t\t\t\tFROM \r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t#KategorieShopPos.kKategorie,\r\n\t\t\t\t\t\t#KategorieShopPos.kShop\r\n\t\t\t\t\tFROM #KategorieShopPos\r\n\t\t\t\t\tINTERSECT\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t#KategoriebaumPos.kKategorie,\r\n\t\t\t\t\t\t#KategoriebaumPos.kShop\r\n\t\t\t\t\tFROM #KategoriebaumPos\r\n\t\t\t\t) AS Kategorien\r\n\t\t\t\tCROSS APPLY dbo.ifKategoriebaum(Kategorien.kKategorie);\r\n\r\n\t\t\tIF EXISTS (SELECT 1 FROM #KategorieToDeleteInPos)\r\n\t\t\tBEGIN\r\n\t\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\t\tSET tEntityPlatform.dInactive = GETDATE()\r\n\t\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\t\tJOIN #KategorieToDeleteInPos ON #KategorieToDeleteInPos.kShop = tEntityPlatform.kShop\r\n\t\t\t\t\tAND #KategorieToDeleteInPos.kKategorie = tEntityPlatform.kEntityId\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 2;\r\n\r\n\t\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\t\tSET tEntityPlatform.dInactive = GETDATE()\r\n\t\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\t\tJOIN\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\ttkategorieartikel.kArtikel,\r\n\t\t\t\t\t\t#KategorieToDeleteInPos.kShop\r\n\t\t\t\t\tFROM dbo.tkategorieartikel\r\n\t\t\t\t\tJOIN #KategorieToDeleteInPos ON #KategorieToDeleteInPos.kKategorie = tkategorieartikel.kKategorie\r\n\t\t\t\t) AS Artikel ON Artikel.kShop = tEntityPlatform.kShop\r\n\t\t\t\t\tAND Artikel.kArtikel = tEntityPlatform.kEntityId\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 1;\r\n\t\t\tEND\r\n\r\n\t\t\tIF EXISTS (SELECT 1 FROM #KategorieToUpdateInPos)\r\n\t\t\tBEGIN\r\n\t\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\t\tFROM Sync.tEntityTracking\r\n\t\t\t\tJOIN\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\ttkategorieartikel.kArtikel,\r\n\t\t\t\t\t\t#KategorieToUpdateInPos.kShop\r\n\t\t\t\t\tFROM dbo.tkategorieartikel\r\n\t\t\t\t\tJOIN #KategorieToUpdateInPos ON #KategorieToUpdateInPos.kKategorie = tkategorieartikel.kKategorie\r\n\t\t\t\t) AS Artikel ON Artikel.kArtikel = tEntityTracking.kEntityId\r\n\t\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tWHERE tEntityTracking.nSyncType = 4;\r\n\t\t\t\t\r\n\t\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\t\tFROM Sync.tEntityTracking\r\n\t\t\t\tJOIN #KategorieToUpdateInPos ON #KategorieToUpdateInPos.kKategorie = tEntityTracking.kEntityId\r\n\t\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tWHERE tEntityTracking.nSyncType = 4;\r\n\t\t\t\t\r\n\t\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\t\tSET tEntityPlatform.dInactive = NULL\r\n\t\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\t\tJOIN #KategorieToUpdateInPos ON #KategorieToUpdateInPos.kShop = tEntityPlatform.kShop\r\n\t\t\t\t\tAND #KategorieToUpdateInPos.kKategorie = tEntityPlatform.kEntityId\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 2;\r\n\r\n\t\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\t\tSET tEntityPlatform.dInactive = NULL\r\n\t\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\t\tJOIN\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\ttkategorieartikel.kArtikel,\r\n\t\t\t\t\t\t#KategorieToUpdateInPos.kShop\r\n\t\t\t\t\tFROM dbo.tkategorieartikel\r\n\t\t\t\t\tJOIN #KategorieToUpdateInPos ON #KategorieToUpdateInPos.kKategorie = tkategorieartikel.kKategorie\r\n\t\t\t\t) AS Artikel ON Artikel.kShop = tEntityPlatform.kShop\r\n\t\t\t\t\tAND Artikel.kArtikel = tEntityPlatform.kEntityId\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 1;\t\t\r\n\t\t\tEND\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorieartikel",
|
|
"triggerName": "tgr_tkategorieartikel_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tkategorieartikel_DEL]\r\nON [dbo].[tkategorieartikel]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtkategorieartikelDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtkategorieartikelDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtkategorieartikelDel\r\n\t(\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkKategorie INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtkategorieartikelDel(kArtikel, kKategorie)\r\n\tSELECT\tDeleted.kArtikel,\r\n\t\t\tDeleted.kKategorie\r\n\tFROM Deleted\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtkategorieartikelDel ON #tgrtkategorieartikelDel.kArtikel = tArtikelShop.kArtikel \r\n\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = #tgrtkategorieartikelDel.kKategorie\r\n\t\tAND tKategorieShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\r\n\t--\r\n\t-- Auch für Varkombi-Kinder\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM\r\n\t(\r\n\t\tSELECT\r\n\t\t\t#tgrtkategorieartikelDel.kArtikel,\r\n\t\t\t#tgrtkategorieartikelDel.kKategorie\r\n\t\tFROM #tgrtkategorieartikelDel\r\n\t) AS Vater\r\n\tJOIN dbo.tArtikel AS Kinder ON Kinder.kVaterArtikel = Vater.kArtikel\r\n\tJOIN dbo.tArtikelShop ON tArtikelShop.kArtikel = Kinder.kArtikel\r\n\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = Vater.kKategorie\r\n\t\tAND tKategorieShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkategorieartikel",
|
|
"triggerName": "tgr_tkategorieartikel_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tkategorieartikel_INSUP]\r\nON [dbo].[tkategorieartikel]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtkategorieartikelInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtkategorieartikelInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtkategorieartikelInsup\r\n\t(\r\n\t\tkKategorieartikel INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtkategorieartikelInsup (kKategorieartikel, kArtikel, kKategorie, nPosBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kKategorieArtikel,\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tInserted.kKategorie,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kKategorie EXCEPT SELECT Deleted.kKategorie) THEN 1 ELSE 0 END AS nPosBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKategorieArtikel = Inserted.kKategorieArtikel;\r\n\r\n\tIF (UPDATE(kKategorie))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtkategorieartikelInsup WHERE #tgrtkategorieartikelInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtkategorieartikelInsup ON #tgrtkategorieartikelInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND #tgrtkategorieartikelInsup.nPosBlock = 1;\r\n\t\tEND\r\n\tEND\r\n\t\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtkategorieartikelInsup ON #tgrtkategorieartikelInsup.kArtikel = tArtikelShop.kArtikel \r\n\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = #tgrtkategorieartikelInsup.kKategorie\r\n\t\tAND tKategorieShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\r\n\t--\r\n\t-- Auch für Varkombi-Kinder\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM\r\n\t(\r\n\t\tSELECT\r\n\t\t\t#tgrtkategorieartikelInsup.kArtikel,\r\n\t\t\t#tgrtkategorieartikelInsup.kKategorie\r\n\t\tFROM #tgrtkategorieartikelInsup\r\n\t) AS Vater\r\n\tJOIN dbo.tArtikel AS Kinder ON Kinder.kVaterArtikel = Vater.kArtikel\r\n\tJOIN dbo.tArtikelShop ON tArtikelShop.kArtikel = Kinder.kArtikel\r\n\tJOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = Vater.kKategorie\r\n\t\tAND tKategorieShop.kShop = tArtikelShop.kShop\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategoriebildPlattform",
|
|
"triggerName": "tgr_tKategoriebildPlattform_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategoriebildPlattform_DEL]\r\nON [dbo].[tKategoriebildPlattform]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKategoriebildPlattformDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKategoriebildPlattformDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKategoriebildPlattformDel\r\n\t(\r\n\t\tkKategoriebildPlattform INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tkPlattform INT NOT NULL,\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tnNr INT NOT NULL,\r\n\t\tnQueueInsert BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKategoriebildPlattformDel (kKategoriebildPlattform, kShop, kPlattform, kKategorie, nNr, nQueueInsert)\r\n\t\tSELECT\r\n\t\t\tDeleted.kKategoriebildPlattform,\r\n\t\t\tDeleted.kShop,\r\n\t\t\tDeleted.kPlattform,\r\n\t\t\tDeleted.kKategorie,\r\n\t\t\tDeleted.nNr,\r\n\t\t\tCASE WHEN Deleted.kShop > 0 THEN 1 ELSE 0 END AS nQueueInsert\r\n\t\tFROM Deleted;\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtKategoriebildPlattformDel WHERE #tgrtKategoriebildPlattformDel.nQueueInsert = 1)\r\n\tBEGIN\r\n\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2)\r\n\t\t\tSELECT \r\n\t\t\t\t#tgrtKategoriebildPlattformDel.kShop,\r\n\t\t\t\t#tgrtKategoriebildPlattformDel.kPlattform, \r\n\t\t\t\t'tKategoriebildPlattform' AS cName,\r\n\t\t\t\t#tgrtKategoriebildPlattformDel.kKategoriebildPlattform, \r\n\t\t\t\t2 AS nAction,\r\n\t\t\t\t#tgrtKategoriebildPlattformDel.kKategorie,\r\n\t\t\t\t#tgrtKategoriebildPlattformDel.nNr\r\n\t\t\tFROM #tgrtKategoriebildPlattformDel\r\n\t\t\tWHERE #tgrtKategoriebildPlattformDel.nQueueInsert = 1;\r\n\tEND\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtKategoriebildPlattformDel ON #tgrtKategoriebildPlattformDel.kKategorie = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 2;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategoriebildPlattform",
|
|
"triggerName": "tgr_tKategoriebildPlattform_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategoriebildPlattform_INSUP]\r\nON [dbo].[tKategoriebildPlattform]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKategoriebildPlattformInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKategoriebildPlattformInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKategoriebildPlattformInsup\r\n\t(\r\n\t\tkKategoriebildPlattform INT NOT NULL,\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tkShopAlt INT NULL,\r\n\t\tkPlattformAlt INT NULL,\r\n\t\tkKategoriebildPlattformAlt INT NULL,\r\n\t\tkKategorieAlt INT NULL,\r\n\t\tkBildAlt INT NULL,\r\n\t\tnNrAlt INT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnInetUpdateBlock BIT NOT NULL,\r\n\t\tnNrDiff BIT NOT NULL,\r\n\t\tnQueueInsert BIT NOT NULL,\r\n\t\tnInsertedBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKategoriebildPlattformInsup (kKategoriebildPlattform, kKategorie, kShop, kShopAlt, kPlattformAlt,\r\n\t\t\t\t\t\t\t\t\t\t\t\t kKategoriebildPlattformAlt, kKategorieAlt, kBildAlt, nNrAlt, nPosBlock, \r\n\t\t\t\t\t\t\t\t\t\t\t\t nInetUpdateBlock, nNrDiff, nQueueInsert, nInsertedBlock)\r\n\t\tSELECT\t\r\n\t\t\tInserted.kKategoriebildPlattform,\r\n\t\t\tInserted.kKategorie,\r\n\t\t\tInserted.kShop,\r\n\t\t\tDeleted.kShop,\r\n\t\t\tDeleted.kPlattform,\r\n\t\t\tDeleted.kKategoriebildPlattform,\r\n\t\t\tDeleted.kKategorie,\r\n\t\t\tDeleted.kBild,\r\n\t\t\tDeleted.nNr,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kBild, Inserted.nNr EXCEPT SELECT Deleted.kBild, Deleted.nNr) \r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN Inserted.nInet = 1 THEN 1 ELSE 0 END AS nInsertBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.nNr EXCEPT SELECT Deleted.nNr) THEN 1 ELSE 0 END AS nNrDiff,\r\n\t\t\tCASE WHEN Deleted.kPlattform = 2\r\n\t\t\t\tAND Deleted.nNr < 1000000000\r\n\t\t\tTHEN 1 ELSE 0 END AS nQueueInsert,\r\n\t\t\tIIF(Deleted.kKategoriebildPlattform IS NULL, 1, 0) AS nInsertedBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKategoriebildPlattform = Inserted.kKategoriebildPlattform;\r\n\r\n\tIF (UPDATE(kBild) OR UPDATE(nNr))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategoriebildPlattformInsup WHERE #tgrtKategoriebildPlattformInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtKategoriebildPlattformInsup ON #tgrtKategoriebildPlattformInsup.kKategorie = tEntityTracking.kEntityId\r\n\t\t\tWHERE #tgrtKategoriebildPlattformInsup.nPosBlock = 1\r\n\t\t\t\tAND tEntityTracking.nEntityType = 2\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4;\r\n\t\tEND\r\n\t\t--\r\n\t\t-- Wenn kBild nicht gleich ist es ein neues Bild und muss übertragen werden\r\n\t\t--\r\n\t\tUPDATE dbo.tKategoriebildPlattform\r\n\t\tSET tKategoriebildPlattform.nInet = 1\r\n\t\tFROM dbo.tKategoriebildPlattform\r\n\t\tJOIN #tgrtKategoriebildPlattformInsup ON #tgrtKategoriebildPlattformInsup.kKategoriebildPlattform = tKategoriebildPlattform.kKategoriebildPlattform\r\n\t\tWHERE #tgrtKategoriebildPlattformInsup.nPosBlock = 1\r\n\t\t\tAND #tgrtKategoriebildPlattformInsup.nInsertedBlock = 0;\r\n\tEND\r\n\t\t\r\n\tIF (UPDATE(nInet))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategoriebildPlattformInsup WHERE #tgrtKategoriebildPlattformInsup.nInetUpdateBlock = 1)\r\n\t\tBEGIN\r\n \t--\r\n\t\t\t-- nInet auf 0 setzen wenn Kategorie gar nicht für Shop aktiv\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tKategoriebildPlattform\r\n\t\t\tSET tKategoriebildPlattform.nInet = 0\r\n\t\t\tFROM dbo.tKategoriebildPlattform\r\n\t\t\tJOIN #tgrtKategoriebildPlattformInsup ON #tgrtKategoriebildPlattformInsup.kKategoriebildPlattform = tKategoriebildPlattform.kKategoriebildPlattform\r\n\t\t\tLEFT JOIN dbo.tKategorieShop ON tKategorieShop.kKategorie = #tgrtKategoriebildPlattformInsup.kKategorie\r\n\t\t\t\tAND tKategorieShop.kShop = #tgrtKategoriebildPlattformInsup.kShop\r\n\t\t\tWHERE tKategorieShop.kKategorie IS NULL\r\n\t\t\t\tAND #tgrtKategoriebildPlattformInsup.nInetUpdateBlock = 1;\r\n\t\tEND\r\n\tEND\r\n\t\r\n\tIF (UPDATE(nNr))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategoriebildPlattformInsup \r\n\t\t\t\t WHERE #tgrtKategoriebildPlattformInsup.nQueueInsert = 1\r\n\t\t\t\t\t\tAND #tgrtKategoriebildPlattformInsup.nNrDiff = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Wenn sich die nNr tBild.cHash geaendert hat tQueue-Loescheintrag fuer Quell-nNr und Ziel-nNr anlegen\r\n\t\t\t--\r\n\t\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgrtKategoriebildPlattformInsup.kShopAlt,\r\n\t\t\t\t\t#tgrtKategoriebildPlattformInsup.kPlattformAlt,\r\n\t\t\t\t\t'tKategoriebildPlattform' AS cName,\r\n\t\t\t\t\t#tgrtKategoriebildPlattformInsup.kKategoriebildPlattformAlt,\r\n\t\t\t\t\t2 AS nAction,\r\n\t\t\t\t\t#tgrtKategoriebildPlattformInsup.kKategorieAlt,\r\n\t\t\t\t\t#tgrtKategoriebildPlattformInsup.nNrAlt\r\n\t\t\t\tFROM #tgrtKategoriebildPlattformInsup\r\n\t\t\t\tJOIN dbo.tBild AS bildDeleted ON bildDeleted.kBild = #tgrtKategoriebildPlattformInsup.kBildAlt\r\n\t\t\t\tJOIN dbo.tBild AS bildInserted ON bildInserted.kBild = #tgrtKategoriebildPlattformInsup.kBildAlt\r\n\t\t\t\tWHERE (#tgrtKategoriebildPlattformInsup.nNrDiff = 1\r\n\t\t\t\t\t\tOR bildDeleted.cHash != bildInserted.cHash)\r\n\t\t\t\t\tAND #tgrtKategoriebildPlattformInsup.nQueueInsert = 1;\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieShop",
|
|
"triggerName": "tgr_tKategorieShop_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategorieShop_DEL]\r\nON [dbo].[tKategorieShop]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKategorieShopDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKategorieShopDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKategorieShopDel\r\n\t(\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tkShop INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKategorieShopDel (kKategorie, kShop)\r\n\t\tSELECT\r\n\t\t\tDeleted.kKategorie,\r\n\t\t\tDeleted.kShop\r\n\t\tFROM Deleted;\r\n\t\r\n\t--\r\n\t-- tQueue schreiben um Kategorien aus Shop zu löschen\r\n\t--\r\n\tINSERT INTO dbo.tQueue(kShop, kPlattform, cName, kWert, nAction)\r\n\t\tSELECT\r\n\t\t\t#tgrtKategorieShopDel.kShop, \r\n\t\t\t2 AS kPlattform, \r\n\t\t\t'tkategorie' AS cName,\r\n\t\t\t#tgrtKategorieShopDel.kKategorie, \r\n\t\t\t2 AS nAction\r\n\t\tFROM #tgrtKategorieShopDel;\r\n\r\n\t--\r\n\t-- tKategoriebildPlattform loeschen\r\n\t--\r\n\tUPDATE dbo.tKategoriebildPlattform\r\n\tSET tKategoriebildPlattform.nInet = 0\r\n\tFROM dbo.tKategoriebildPlattform\r\n\tJOIN #tgrtKategorieShopDel ON #tgrtKategorieShopDel.kKategorie = tKategoriebildPlattform.kKategorie\r\n\t\tAND #tgrtKategorieShopDel.kShop = tKategoriebildPlattform.kShop\r\n\tWHERE tKategoriebildPlattform.nInet = 1;\r\n\r\n\tUPDATE Sync.tEntityPlatform\r\n\t\tSET tEntityPlatform.dInactive = GETDATE()\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN #tgrtKategorieShopDel ON #tgrtKategorieShopDel.kShop = tEntityPlatform.kShop\r\n\t\tAND #tgrtKategorieShopDel.kKategorie = tEntityPlatform.kEntityId\r\n\t\tAND tEntityPlatform.nEntityType = 2;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieShop",
|
|
"triggerName": "tgr_tKategorieShop_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategorieShop_INSUP]\r\nON [dbo].[tKategorieShop]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKategorieShopInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKategorieShopInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKategorieShopInsup\r\n\t(\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tnInetUpdateBlock BIT NOT NULL,\r\n\t\tnInet BIT NOT NULL,\r\n\t\tnInetY BIT NOT NULL,\r\n\t\tnInserted BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKategorieShopInsup (kKategorie, kShop, nInetUpdateBlock, nInet, nInetY, nInserted)\r\n\t\tSELECT\r\n\t\t\tInserted.kKategorie,\r\n\t\t\tInserted.kShop,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cInet EXCEPT SELECT Deleted.cInet) \r\n\t\t\t\tAND Inserted.cInet = 'Y' THEN 1 ELSE 0 END AS nInetUpdateBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cInet EXCEPT SELECT Deleted.cInet) THEN 1 ELSE 0 END AS nInet,\r\n\t\t\tCASE WHEN Inserted.cInet = 'Y' THEN 1 ELSE 0 END AS nInetY,\r\n\t\t\tCASE WHEN Deleted.kKategorie IS NULL THEN 1 ELSE 0 END AS nInserted\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKategorie = Inserted.kKategorie\r\n\t\t\tAND Deleted.kShop = Inserted.kShop;\r\n\r\n\tIF (UPDATE(cInet))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategorieShopInsup WHERE #tgrtKategorieShopInsup.nInetUpdateBlock = 1)\r\n\t\tBEGIN\r\n \tUPDATE dbo.tKategoriebildPlattform\r\n\t\t\tSET tKategoriebildPlattform.nInet = 1\r\n\t\t\tFROM dbo.tKategoriebildPlattform\r\n\t\t\tJOIN #tgrtKategorieShopInsup ON #tgrtKategorieShopInsup.kKategorie = tKategoriebildPlattform.kKategorie\r\n\t\t\t\tAND #tgrtKategorieShopInsup.kShop = tKategoriebildPlattform.kShop\r\n\t\t\tWHERE tKategoriebildPlattform.nInet = 0\r\n\t\t\t\tAND #tgrtKategorieShopInsup.nInetUpdateBlock = 1;\r\n\t\tEND\r\n\t\t\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategorieShopInsup WHERE #tgrtKategorieShopInsup.nInet = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE dbo.tKategorieShop \r\n\t\t\tSET dbo.tKategorieShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tKategorieShop\r\n\t\t\tJOIN #tgrtKategorieShopInsup ON dbo.tKategorieShop.kKategorie = #tgrtKategorieShopInsup.kKategorie\r\n\t\t\t\tAND dbo.tKategorieShop.kShop = #tgrtKategorieShopInsup.kShop\r\n\t\t\t\tAND #tgrtKategorieShopInsup.nInet = 1;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategorieShopInsup WHERE #tgrtKategorieShopInsup.nInetY = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 1,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtKategorieShopInsup ON #tgrtKategorieShopInsup.kShop = tArtikelShop.kShop\r\n\t\t\tJOIN dbo.tkategorieartikel ON tkategorieartikel.kArtikel = tArtikelShop.kArtikel\r\n\t\t\t\tAND tkategorieartikel.kKategorie = #tgrtKategorieShopInsup.kKategorie\r\n\t\t\tWHERE #tgrtKategorieShopInsup.nInetY = 1\r\n\t\t\t\tAND #tgrtKategorieShopInsup.nInserted = 1\r\n\t\t\t\tAND (tArtikelShop.cInet = 'N'\r\n\t\t\t\t\tOR tArtikelShop.nAktion IN (0,2,4,6,8)\r\n\t\t\t\t\tOR tArtikelShop.nInBearbeitung = 1);\r\n\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN dbo.tkategorieartikel ON tkategorieartikel.kArtikel = tEntityTracking.kEntityId\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\t\tJOIN #tgrtKategorieShopInsup ON #tgrtKategorieShopInsup.kKategorie = tkategorieartikel.kKategorie\r\n\t\t\tWHERE #tgrtKategorieShopInsup.nInetY = 1;\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtKategorieShopInsup WHERE #tgrtKategorieShopInsup.nInserted = 1)\r\n\tBEGIN\r\n\t\t-- Connector\r\n\t\t--\r\n\t\t-- Bilder vollständig zu Webshop wenden, wenn Änderungen vorgenommen wurden\r\n\t\t--\r\n\t\tUPDATE dbo.tKategoriebildPlattform\r\n\t\tSET tKategoriebildPlattform.nInet = 1\r\n\t\tFROM dbo.tKategoriebildPlattform\r\n\t\tJOIN #tgrtKategorieShopInsup ON #tgrtKategorieShopInsup.kKategorie = tKategoriebildPlattform.kKategorie\r\n\t\t\tAND #tgrtKategorieShopInsup.kShop = tKategoriebildPlattform.kShop\r\n\t\tWHERE tKategoriebildPlattform.nInet = 0\r\n\t\t\tAND #tgrtKategorieShopInsup.nInserted = 1;\r\n\t\t\r\n\t\t--\r\n\t\t-- Evtl. bestehenden Löscheinträge in tQueue entfernen\r\n\t\t--\r\n\t\tDELETE dbo.tQueue\r\n\t\tFROM dbo.tQueue\r\n\t\tJOIN #tgrtKategorieShopInsup ON #tgrtKategorieShopInsup.kShop = tQueue.kShop\r\n\t\t\tAND #tgrtKategorieShopInsup.kKategorie = tQueue.kWert\r\n\t\tWHERE tQueue.cName = 'tkategorie'\r\n\t\t\tAND tQueue.nAction = 2\r\n\t\t\tAND #tgrtKategorieShopInsup.nInserted = 1;\r\n\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\r\n\t\tIF(OBJECT_ID('tempdb..#tgr_tKategorieShop_Sync') IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tDROP TABLE #tgr_tKategorieShop_Sync;\r\n\t\tEND\r\n\r\n\t\tCREATE TABLE #tgr_tKategorieShop_Sync\r\n\t\t(\r\n\t\t\tkKategorie INT,\r\n\t\t\tkShop INT,\r\n\t\t\tnSyncType TINYINT,\r\n\t\t\tkEntityId INT,\r\n\t\t);\r\n\r\n\t\tINSERT INTO #tgr_tKategorieShop_Sync (kKategorie, kShop, nSyncType, kEntityId)\r\n\t\t\tSELECT \r\n\t\t\t\t#tgrtKategorieShopInsup.kKategorie, \r\n\t\t\t\t#tgrtKategorieShopInsup.kShop,\r\n\t\t\t\ttShop.nTyp,\r\n\t\t\t\ttEntityPlatform.kEntityId\r\n\t\t\tFROM #tgrtKategorieShopInsup\r\n\t\t\tJOIN dbo.tShop ON tShop.kShop = #tgrtKategorieShopInsup.kShop\r\n\t\t\tLEFT JOIN Sync.tEntityPlatform ON tEntityPlatform.kShop = #tgrtKategorieShopInsup.kShop\r\n\t\t\t\tAND tEntityPlatform.kEntityId = #tgrtKategorieShopInsup.kKategorie\r\n\t\t\t\tAND tEntityPlatform.nEntityType = 2\r\n\t\t\tWHERE tShop.nTyp NOT IN (2, 3)\r\n\t\t\t\tAND #tgrtKategorieShopInsup.nInserted = 1\r\n\t\t\tGROUP BY #tgrtKategorieShopInsup.kKategorie, \r\n\t\t\t\t#tgrtKategorieShopInsup.kShop, \r\n\t\t\t\ttShop.nTyp,\r\n\t\t\t\ttEntityPlatform.kEntityId;\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tKategorieShop_Sync WHERE #tgr_tKategorieShop_Sync.kEntityId IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\tSET tEntityPlatform.dActive = GETDATE(),\r\n\t\t\t\t\ttEntityPlatform.dInactive = NULL\r\n\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\tJOIN #tgr_tKategorieShop_Sync ON #tgr_tKategorieShop_Sync.kEntityId = tEntityPlatform.kEntityId\r\n\t\t\t\tAND #tgr_tKategorieShop_Sync.kShop = tEntityPlatform.kShop\r\n\t\t\t\tAND tEntityPlatform.nEntityType = 2;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tKategorieShop_Sync WHERE #tgr_tKategorieShop_Sync.kEntityId IS NULL)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO Sync.tEntityPlatform (kEntityId, nEntityType, kShop, dActive, dInactive)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgr_tKategorieShop_Sync.kKategorie AS kEntityId,\r\n\t\t\t\t\t2 AS nEntityType,\r\n\t\t\t\t\t#tgr_tKategorieShop_Sync.kShop AS kShop,\r\n\t\t\t\t\tGETDATE() AS dActive,\r\n\t\t\t\t\tNULL AS dInactive\r\n\t\t\t\tFROM #tgr_tKategorieShop_Sync\r\n\t\t\t\tWHERE #tgr_tKategorieShop_Sync.kEntityId IS NULL;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tKategorieShop_Sync WHERE #tgr_tKategorieShop_Sync.kEntityId IS NULL)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO Sync.tEntityTracking (kEntityId, nEntityType, nSyncType, dCreated, dLastModified)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgr_tKategorieShop_Sync.kKategorie AS kEntityId,\r\n\t\t\t\t\t2 AS nEntityType,\r\n\t\t\t\t\t#tgr_tKategorieShop_Sync.nSyncType,\r\n\t\t\t\t\tGETDATE() AS dCreated,\r\n\t\t\t\t\tGETDATE() AS dLastModified\r\n\t\t\t\tFROM #tgr_tKategorieShop_Sync\r\n\t\t\t\tLEFT JOIN Sync.tEntityTracking ON tEntityTracking.kEntityId = #tgr_tKategorieShop_Sync.kKategorie\r\n\t\t\t\t\tAND tEntityTracking.nEntityType = 2\r\n\t\t\t\t\tAND tEntityTracking.nSyncType = #tgr_tKategorieShop_Sync.nSyncType\r\n\t\t\t\tWHERE tEntityTracking.kEntityId IS NULL\r\n\t\t\t\tGROUP BY #tgr_tKategorieShop_Sync.kKategorie, \r\n\t\t\t\t\t#tgr_tKategorieShop_Sync.nSyncType;\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieSprache",
|
|
"triggerName": "tgr_tKategorieSprache_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategorieSprache_DEL]\r\nON [dbo].[tKategorieSprache]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking \r\n\tJOIN Deleted ON Deleted.kKategorie = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 2\r\n\t\tAND tEntityTracking.nSyncType = 4;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKategorieSprache",
|
|
"triggerName": "tgr_tKategorieSprache_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKategorieSprache_INSUP]\r\nON [dbo].[tKategorieSprache]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (NOT (UPDATE(cName) OR UPDATE(cBeschreibung) OR UPDATE(cUrlPfad) OR UPDATE(cMetaDescription) OR UPDATE(cTitleTag) OR UPDATE(cMetaKeywords)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKategorieSpracheInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKategorieSpracheInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKategorieSpracheInsup\r\n\t(\r\n\t\tkKategorie INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnConnectorBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKategorieSpracheInsup (kKategorie, kShop, nPosBlock, nConnectorBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kKategorie,\r\n\t\t\tInserted.kShop,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cName EXCEPT SELECT Deleted.cName) THEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.cName, Inserted.cBeschreibung, Inserted.cUrlPfad, Inserted.cMetaDescription, Inserted.cTitleTag, Inserted.cMetaKeywords\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.cName, Deleted.cBeschreibung, Deleted.cUrlPfad, Deleted.cMetaDescription, Deleted.cTitleTag, Deleted.cMetaKeywords\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nConnectorBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKategorie = Inserted.kKategorie\r\n\t\t\tAND Deleted.kSprache = Inserted.kSprache\r\n\t\t\tAND Deleted.kPlattform = Inserted.kPlattform\r\n\t\t\tAND Deleted.kShop = Inserted.kShop;\r\n\r\n\tIF (UPDATE(cName))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKategorieSpracheInsup WHERE #tgrtKategorieSpracheInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtKategorieSpracheInsup ON #tgrtKategorieSpracheInsup.kKategorie = tEntityTracking.kEntityId\r\n\t\t\tWHERE #tgrtKategorieSpracheInsup.nPosBlock = 1\r\n\t\t\t\tAND tEntityTracking.nEntityType = 2\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4;\r\n\t\tEND\r\n\r\n\t\tIF (UPDATE(cBeschreibung) OR UPDATE(cUrlPfad) OR UPDATE(cMetaDescription) OR UPDATE(cTitleTag) OR UPDATE(cTitleTag) OR UPDATE(cMetaKeywords))\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- Connector\r\n\t\t\t--\r\n\t\t\tIF EXISTS (SELECT 1 FROM #tgrtKategorieSpracheInsup WHERE #tgrtKategorieSpracheInsup.nConnectorBlock = 1)\r\n\t\t\tBEGIN\r\n\t\t\t\t--\r\n\t\t\t\t-- Alle Shops abgleichen deren Kategoriebeschreibungen sich geändert haben\r\n\t\t\t\t-- Gilt für alle Shopspezifischen Kategoriebeschreibungen\r\n\t\t\t\t--\r\n\t\t\t\tUPDATE dbo.tKategorieShop\r\n\t\t\t\tSET tKategorieShop.cInet = 'Y'\r\n\t\t\t\tFROM dbo.tKategorieShop\r\n\t\t\t\tJOIN #tgrtKategorieSpracheInsup ON #tgrtKategorieSpracheInsup.kKategorie = tKategorieShop.kKategorie\r\n\t\t\t\t\tAND #tgrtKategorieSpracheInsup.kShop = tKategorieShop.kShop\r\n\t\t\t\tWHERE #tgrtKategorieSpracheInsup.nConnectorBlock = 1;\r\n\r\n\t\t\t\t--\r\n\t\t\t\t-- Alle Shops abgleichen deren Kategoriebeschreibungen sich geändert haben\r\n\t\t\t\t-- Gilt für alle globalen Kategoriebeschreibungen\r\n\t\t\t\t--\r\n\t\t\t\tUPDATE dbo.tKategorieShop\r\n\t\t\t\tSET tKategorieShop.cInet = 'Y'\r\n\t\t\t\tFROM dbo.tKategorieShop\r\n\t\t\t\tLEFT JOIN dbo.tKategorieSprache ON tKategorieSprache.kKategorie = tKategorieShop.kKategorie\r\n\t\t\t\t\tAND tKategorieSprache.kShop = tKategorieShop.kShop\r\n\t\t\t\t\tAND tKategorieSprache.kPlattform = 2\r\n\t\t\t\tJOIN #tgrtKategorieSpracheInsup ON #tgrtKategorieSpracheInsup.kKategorie = tKategorieShop.kKategorie\r\n\t\t\t\t\tAND #tgrtKategorieSpracheInsup.kShop = 0\r\n\t\t\t\tWHERE #tgrtKategorieSpracheInsup.nConnectorBlock = 1;\r\n\t\t\tEND\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"triggerName": "tgr_tKunde_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKunde_DEL]\r\nON [dbo].[tkunde]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\t\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityPlatform\r\n\t\tSET tEntityPlatform.dInactive = GETDATE()\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN Deleted ON Deleted.kKunde = tEntityPlatform.kEntityId\r\n\t\tAND tEntityPlatform.nEntityType = 4;\t\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"triggerName": "tgr_tKunde_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKunde_INSUP]\r\nON [dbo].[tkunde]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKundeInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKundeInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKundeInsup\r\n\t(\r\n\t\tkKunde INT NOT NULL,\r\n\t\tcKassenkunde NVARCHAR(1) NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnPosUpdate BIT NOT NULL,\r\n\t\tnKassenkunde BIT NOT NULL,\r\n\t\tnInserted BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKundeInsup (kKunde, cKassenkunde, nPosBlock, nPosUpdate, nKassenkunde, nInserted)\r\n\t\tSELECT\r\n\t\t\tInserted.kKunde,\r\n\t\t\tInserted.cKassenKunde,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.cKundenNr, Inserted.kKundenGruppe, Inserted.fRabatt, Inserted.cSteuerNr, Inserted.cGeburtstag, Inserted.nDebitorennr\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.cKundenNr, Deleted.kKundenGruppe, Deleted.fRabatt, Deleted.cSteuerNr, Deleted.cGeburtstag, Deleted.nDebitorennr\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cKassenKunde EXCEPT SELECT Deleted.cKassenKunde) \r\n\t\t\t\tAND ISNULL(Deleted.cKassenKunde, '') != 'Y'\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosUpdate,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cKassenKunde EXCEPT SELECT Deleted.cKassenKunde) \r\n\t\t\t\tAND ISNULL(Deleted.cKassenKunde, '') = 'Y'\r\n\t\t\tTHEN 1 ELSE 0 END AS nKassenkunde,\r\n\t\t\tCASE WHEN Deleted.kKunde IS NULL THEN 1 ELSE 0 END AS nInserted\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKunde = Inserted.kKunde;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tIF (UPDATE(cKundenNr) OR UPDATE(kKundenGruppe) OR UPDATE(fRabatt) OR UPDATE(cSteuerNr) OR UPDATE(cGeburtstag) OR UPDATE(nDebitorennr))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundeInsup WHERE #tgrtKundeInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtKundeInsup ON #tgrtKundeInsup.kKunde = tEntityTracking.kEntityId\r\n\t\t\tWHERE #tgrtKundeInsup.nPosBlock = 1\r\n\t\t\t\tAND tEntityTracking.nEntityType = 4\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF (UPDATE(cKassenKunde))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundeInsup WHERE #tgrtKundeInsup.nKassenkunde = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\tSET tEntityPlatform.dInactive = GETDATE()\r\n\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\tJOIN #tgrtKundeInsup ON #tgrtKundeInsup.kKunde = tEntityPlatform.kEntityId\r\n\t\t\t\tAND tEntityPlatform.nEntityType = 4\r\n\t\t\t\tAND #tgrtKundeInsup.nKassenkunde = 1;\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtKundeInsup WHERE #tgrtKundeInsup.nInserted = 1 OR #tgrtKundeInsup.nPosUpdate = 1)\r\n\tBEGIN\r\n\t\tIF(OBJECT_ID('tempdb..#tgr_tKunde_Sync') IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tDROP TABLE #tgr_tKunde_Sync;\r\n\t\tEND\r\n\r\n\t\tCREATE TABLE #tgr_tKunde_Sync\r\n\t\t(\r\n\t\t\tkId INT,\r\n\t\t\tkShop INT,\r\n\t\t\tnSyncType TINYINT,\r\n\t\t\tnEntityType TINYINT,\r\n\t\t\tkEntityId INT,\r\n\t\t);\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundeInsup WHERE #tgrtKundeInsup.nInserted = 1)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO #tgr_tKunde_Sync (kId, kShop, nSyncType, nEntityType, kEntityId)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgrtKundeInsup.kKunde,\r\n\t\t\t\t\ttShop.kShop,\r\n\t\t\t\t\ttShop.nTyp,\r\n\t\t\t\t\t4 AS nEntityType,\r\n\t\t\t\t\ttEntityPlatform.kEntityId\r\n\t\t\t\tFROM #tgrtKundeInsup\r\n\t\t\t\tCROSS JOIN dbo.tShop\r\n\t\t\t\tLEFT JOIN Sync.tEntityPlatform ON tEntityPlatform.kShop = tShop.kShop\r\n\t\t\t\t\tAND tEntityPlatform.kEntityId = #tgrtKundeInsup.kKunde\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 4\r\n\t\t\t\tWHERE tShop.nTyp = 4\r\n\t\t\t\t\tAND #tgrtKundeInsup.cKassenKunde = 'Y'\r\n\t\t\t\t\tAND #tgrtKundeInsup.nInserted = 1\r\n\t\t\t\tGROUP BY #tgrtKundeInsup.kKunde, \r\n\t\t\t\t\ttShop.kShop,\r\n\t\t\t\t\ttShop.nTyp,\r\n\t\t\t\t\ttEntityPlatform.kEntityId;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundeInsup WHERE #tgrtKundeInsup.nPosUpdate = 1)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO #tgr_tKunde_Sync (kId, kShop, nSyncType, nEntityType, kEntityId)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgrtKundeInsup.kKunde,\r\n\t\t\t\t\ttShop.kShop,\r\n\t\t\t\t\ttShop.nTyp,\r\n\t\t\t\t\t4 AS nEntityType,\r\n\t\t\t\t\ttEntityPlatform.kEntityId\r\n\t\t\t\tFROM #tgrtKundeInsup\r\n\t\t\t\tCROSS JOIN dbo.tShop\r\n\t\t\t\tLEFT JOIN Sync.tEntityPlatform ON tEntityPlatform.kShop = tShop.kShop\r\n\t\t\t\t\tAND tEntityPlatform.kEntityId = #tgrtKundeInsup.kKunde\r\n\t\t\t\t\tAND tEntityPlatform.nEntityType = 4\r\n\t\t\t\tWHERE tShop.nTyp = 4\r\n\t\t\t\t\tAND #tgrtKundeInsup.nPosUpdate = 1\r\n\t\t\t\tGROUP BY #tgrtKundeInsup.kKunde, \r\n\t\t\t\t\ttShop.kShop,\r\n\t\t\t\t\ttShop.nTyp,\r\n\t\t\t\t\ttEntityPlatform.kEntityId;\r\n\t\tEND\r\n\r\n\t\t--\r\n\t\t-- Insert\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tKunde_Sync WHERE #tgr_tKunde_Sync.kEntityId IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\t\tSET tEntityPlatform.dActive = GETDATE(),\r\n\t\t\t\t\ttEntityPlatform.dInactive = NULL\r\n\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\tJOIN #tgr_tKunde_Sync ON #tgr_tKunde_Sync.kEntityId = tEntityPlatform.kEntityId\r\n\t\t\t\tAND #tgr_tKunde_Sync.kShop = tEntityPlatform.kShop\r\n\t\t\t\tAND tEntityPlatform.nEntityType = #tgr_tKunde_Sync.nEntityType;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tKunde_Sync WHERE #tgr_tKunde_Sync.kEntityId IS NULL)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO Sync.tEntityPlatform (kEntityId, nEntityType, kShop, dActive, dInactive)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgr_tKunde_Sync.kId AS kEntityId,\r\n\t\t\t\t\t#tgr_tKunde_Sync.nEntityType AS nEntityType,\r\n\t\t\t\t\t#tgr_tKunde_Sync.kShop AS kShop,\r\n\t\t\t\t\tGETDATE() AS dActive,\r\n\t\t\t\t\tNULL AS dInactive\r\n\t\t\t\tFROM #tgr_tKunde_Sync\r\n\t\t\t\tWHERE #tgr_tKunde_Sync.kEntityId IS NULL\r\n\t\t\t\tGROUP BY #tgr_tKunde_Sync.kId,\r\n\t\t\t\t\t#tgr_tKunde_Sync.nEntityType,\r\n\t\t\t\t\t#tgr_tKunde_Sync.kShop;\r\n\t\tEND\r\n\r\n\t\tINSERT INTO Sync.tEntityTracking (kEntityId, nEntityType, nSyncType, dCreated, dLastModified)\r\n\t\t\tSELECT\r\n\t\t\t\t#tgr_tKunde_Sync.kId,\r\n\t\t\t\t#tgr_tKunde_Sync.nEntityType,\r\n\t\t\t\t#tgr_tKunde_Sync.nSyncType,\r\n\t\t\t\tGETDATE() AS dCreated,\r\n\t\t\t\tNULL AS dLastModified\r\n\t\t\tFROM #tgr_tKunde_Sync\r\n\t\t\tLEFT JOIN Sync.tEntityTracking ON tEntityTracking.kEntityId = #tgr_tKunde_Sync.kId\r\n\t\t\t\tAND tEntityTracking.nSyncType = #tgr_tKunde_Sync.nSyncType\r\n\t\t\t\tAND tEntityTracking.nEntityType = #tgr_tKunde_Sync.nEntityType\r\n\t\t\tWHERE tEntityTracking.kEntityId IS NULL\r\n\t\t\tGROUP BY #tgr_tKunde_Sync.kId,\r\n\t\t\t\t#tgr_tKunde_Sync.nEntityType,\r\n\t\t\t\t#tgr_tKunde_Sync.nSyncType;\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tkunde",
|
|
"triggerName": "tgr_tKunde_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKunde_INSUPDEL]\r\nON [dbo].[tkunde]\r\nAFTER INSERT, UPDATE, DELETE\r\nAS\r\nSET NOCOUNT ON;\r\n\tIF NOT EXISTS(SELECT * FROM INSERTED FULL JOIN DELETED ON INSERTED.kKunde = DELETED.kKunde)\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND;\r\n\r\n --\r\n\t-- Ausnahmen:\r\n\t--\r\n\tIF(CONTEXT_INFO() IN(HASHBYTES('SHA1', 'Kunde.spKundeInsert'), HASHBYTES('SHA1', 'Kunde.spKundeUpdate'), HASHBYTES('SHA1', 'Kunde.spKundeDelete'), HASHBYTES('SHA1', 'dbo.spXmlBestellimportKundeLoeschen')))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\tROLLBACK;\r\n\tRAISERROR (N'Die Tabelle dbo.tKunde kann nur über die SPs Kunde.spKundeInsert, Kunde.spKundeUpdate und Kunde.spKundeDelete geändert werden.', 15,1);\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKundenGruppe",
|
|
"triggerName": "jtlActionValidator_tKundenGruppe",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tKundenGruppe]\r\nON [dbo].[tKundenGruppe]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN\r\n\tDELETE FROM dbo.tShopMappingKundengruppe\r\n\t\tWHERE dbo.tShopMappingKundengruppe.kKundengruppe IN (\r\n\t\t\tSELECT DELETED.kKundenGruppe FROM DELETED);\r\n\r\n\tDELETE FROM dbo.tkonfigitempreis\r\n\t\tWHERE dbo.tkonfigitempreis.kKundengruppe IN (\r\n\t\t\tSELECT DELETED.kKundenGruppe FROM DELETED);\r\n\t\r\n\tDELETE FROM dbo.tPreis\r\n\tWHERE tPreis.kKundenGruppe IN (\r\n\t\tSELECT Deleted.kKundenGruppe FROM Deleted);\r\n\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKundenGruppe",
|
|
"triggerName": "tgr_tkundengruppe_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tkundengruppe_DELETE]\r\nON [dbo].[tKundenGruppe]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKundengruppeDelete') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKundengruppeDelete;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKundengruppeDelete\r\n\t(\r\n\t\tkKundengruppe INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKundengruppeDelete (kKundengruppe)\r\n\t\tSELECT\r\n\t\t\tDeleted.kKundenGruppe\r\n\t\tFROM Deleted\r\n\r\n\tIF(EXISTS(SELECT #tgrtKundengruppeDelete.* \r\n\t\t\t\tFROM #tgrtKundengruppeDelete\r\n\t\t\t\tJOIN Amazon.tPreiskonfiguration ON tPreiskonfiguration.kKundengruppe = #tgrtKundengruppeDelete.kKundenGruppe))\r\n\tBEGIN\r\n\t\tROLLBACK;\r\n\t\tRAISERROR('Kundengruppe kann nicht gelöscht werden da sie bei einem Amazonkonto hinterlegt ist', 18,10);\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tUPDATE Sync.tEntityPlatform\r\n\tSET tEntityPlatform.dInactive = GETDATE()\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN #tgrtKundengruppeDelete ON #tgrtKundengruppeDelete.kKundengruppe = tEntityPlatform.kEntityId\r\n\t\tAND tEntityPlatform.nEntityType = 6;\r\n\r\n UPDATE Sync.tEntityTracking\r\n SET tEntityTracking.dLastModified = GETDATE()\r\n FROM Sync.tEntityTracking\r\n JOIN #tgrtKundengruppeDelete ON #tgrtKundengruppeDelete.kKundengruppe = tEntityTracking.kEntityId\r\n WHERE tEntityTracking.nEntityType = 6\r\n AND tEntityTracking.nSyncType = 4;\r\n\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tKundenGruppe",
|
|
"triggerName": "tgr_tKundenGruppe_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tKundenGruppe_INSUP]\r\nON [dbo].[tKundenGruppe]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtKundenGruppeInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtKundenGruppeInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtKundenGruppeInsup\r\n\t(\r\n\t\tkKundengruppe INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnConnectorBlock BIT NOT NULL,\r\n\t\tnInserted BIT NOT NULL,\r\n\t\tnRabatt BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtKundenGruppeInsup (kKundengruppe, nPosBlock, nConnectorBlock, nInserted, nRabatt)\r\n\t\tSELECT\r\n\t\t\tInserted.kKundenGruppe,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.cName, Inserted.nStandard, Inserted.fRabatt\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.cName, Deleted.nStandard, Deleted.fRabatt\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.cName, Inserted.nStandard, Inserted.nShopLogin, Inserted.nNettoPreise, Inserted.fRabatt, Inserted.kKundenDrucktext\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.cName, Deleted.nStandard, Deleted.nShopLogin, Deleted.nNettoPreise, Deleted.fRabatt, Deleted.kKundenDrucktext\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nConnectorBlock,\r\n\t\t\tCASE WHEN Deleted.kKundenGruppe IS NULL THEN 1 ELSE 0 END nInserted,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.fRabatt EXCEPT SELECT Deleted.fRabatt) THEN 1 ELSE 0 END AS nRabatt\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kKundenGruppe = Inserted.kKundenGruppe;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tIF (UPDATE(cName) OR UPDATE(nStandard) OR UPDATE(fRabatt))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundenGruppeInsup WHERE #tgrtKundenGruppeInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtKundenGruppeInsup ON #tgrtKundenGruppeInsup.kKundengruppe = tEntityTracking.kEntityId\r\n\t\t\t\tAND #tgrtKundenGruppeInsup.nPosBlock = 1\r\n\t\t\tWHERE tEntityTracking.nEntityType = 6\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4;\r\n\t\tEND\r\n\tEND\r\n\r\n\t--\r\n\t-- Kundengruppe\r\n\t--\r\n\tIF EXISTS (SELECT 1 FROM #tgrtKundenGruppeInsup WHERE #tgrtKundenGruppeInsup.nInserted = 1)\r\n\tBEGIN\r\n\t\tINSERT INTO dbo.tShopKundenGruppe(kWebShop, kKundenGruppe, nStandard)\r\n\t\t\tSELECT\r\n\t\t\t\ttShop.kShop,\r\n\t\t\t\t#tgrtKundenGruppeInsup.kKundenGruppe,\r\n\t\t\t\t0\r\n\t\t\tFROM dbo.tShop\r\n\t\t\tCROSS JOIN #tgrtKundenGruppeInsup\r\n\t\t\tLEFT JOIN dbo.tShopKundenGruppe ON tShopKundenGruppe.kWebShop = tShop.kShop\r\n\t\t\t\tAND tShopKundenGruppe.kKundenGruppe = #tgrtKundenGruppeInsup.kKundenGruppe\r\n\t\t\tWHERE tShop.nTyp = 4 \r\n\t\t\t\tAND tShopKundenGruppe.kKundenGruppe IS NULL\r\n\t\t\t\tAND #tgrtKundenGruppeInsup.nInserted = 1;\r\n\tEND\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\tIF EXISTS (SELECT 1 FROM #tgrtKundenGruppeInsup WHERE #tgrtKundenGruppeInsup.nConnectorBlock = 1)\r\n\tBEGIN\r\n\t\tINSERT INTO dbo.tGlobalsQueue (kShop, nType, cName, kKey)\r\n\t\t\tSELECT \r\n\t\t\t\ttShopKundenGruppe.kWebShop,\r\n\t\t\t\t1 AS nType,\r\n\t\t\t\t'tKundengruppe' AS cName,\r\n\t\t\t\t0 AS kKey\r\n\t\t\tFROM dbo.tShopKundenGruppe\r\n\t\t\tJOIN dbo.tShop ON tShop.kShop = tShopKundenGruppe.kWebShop\r\n\t\t\t\tAND tShop.nTyp = 0\r\n\t\t\tJOIN #tgrtKundenGruppeInsup ON #tgrtKundenGruppeInsup.kKundenGruppe = tShopKundenGruppe.kKundenGruppe\r\n\t\t\t\tAND #tgrtKundenGruppeInsup.nConnectorBlock = 1\r\n\t\t\tGROUP BY dbo.tShopKundenGruppe.kWebShop;\r\n\tEND\r\n\r\n\tIF (UPDATE(fRabatt))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtKundenGruppeInsup WHERE #tgrtKundenGruppeInsup.nRabatt = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- SCX\r\n\t\t\t--\r\n\t\t\t-- SCX-Artikel neu hochladen\r\n\t\t\tUPDATE tArtikelShop\r\n\t\t\tSET tArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nAktion = tArtikelShop.nAktion | 1\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN dbo.tShop ON tArtikelShop.kShop = tShop.kShop\r\n\t\t\tJOIN SCX.tChannelPriceType ON tShop.kShop = tChannelPriceType.kShop\r\n\t\t\tJOIN #tgrtKundenGruppeInsup ON #tgrtKundenGruppeInsup.kKundengruppe = tChannelPriceType.kKundenGruppe\r\n\t\t\tWHERE tShop.nTyp = 6\r\n\t\t\t\tAND #tgrtKundenGruppeInsup.nRabatt = 1\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tLieferschein",
|
|
"triggerName": "tgr_tLieferschein_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tLieferschein_INSUPDEL]\r\nON [dbo].[tLieferschein]\r\nAFTER INSERT, DELETE\r\nAS \r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tIF(CONTEXT_INFO() IN (0x5113, 0x5114))\r\n\tBEGIN\r\n\r\n\t\tINSERT INTO dbo.tLieferscheinEckdaten\r\n\t\t(\r\n\t\t\tdErstellt,\r\n\t\t\tkLieferschein,\r\n\t\t\tdVersendet,\r\n\t\t\tnAnzahlPakete,\r\n\t\t\tnAnzahlVersendetePakete,\r\n\t\t\tnVersandStatus,\r\n\t\t\tkVersandArt,\r\n\t\t\tnRechnungStatus,\r\n\t\t\tfArtikelGewicht,\r\n\t\t\tfVersandGewicht\r\n\t\t)\r\n\t\tSELECT\r\n\t\t\tInserted.dErstellt,\r\n\t\t\tInserted.kLieferschein,\r\n\t\t\tNULL AS dVersendet,\r\n\t\t\t0 AS nAnzahlPakete,\r\n\t\t\t0 AS nAnzahlVersendetePakete,\r\n\t\t\tNULL AS nShippingStatus,\r\n\t\t\tNULL AS kVersandart,\r\n\t\t\t0 AS nRechnungStatus, --nicht abgerechnet\r\n\t\t\t0.0 AS fArtikelgewicht,\r\n\t\t\t0.0 AS fVersandgewicht\r\n\t\tFROM Inserted\r\n\t\tLEFT JOIN Deleted ON Deleted.kLieferschein = Inserted.kLieferschein\r\n\t\tWHERE Deleted.kLieferschein IS NULL\r\n\r\n\t\tDELETE dbo.tLieferscheinEckdaten\r\n\t\tFROM dbo.tLieferscheinEckdaten\r\n\t\tJOIN Deleted ON Deleted.kLieferschein = tLieferscheinEckdaten.kLieferschein\r\n\t\tLEFT JOIN Inserted ON Inserted.kLieferschein = Deleted.kLieferschein\r\n\t\tWHERE Inserted.kLieferschein IS NULL\r\n\r\n\t\tRETURN;\r\n\tEND\t\r\n\tRAISERROR(N'Die Tabelle dbo.tLieferschein kann nur über die SPs spLieferscheinErstellen und spLieferscheinLoeschen bearbeitet werden.', 15,1);\r\n\tROLLBACK;\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPickliste",
|
|
"triggerName": "jtlActionValidator_tPickliste",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "--\r\n-- CleanUp-Trigger für das Löschen von Picklisten\r\n--\r\nCREATE TRIGGER [dbo].[jtlActionValidator_tPickliste]\r\nON [dbo].[tPickliste]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN\r\n IF EXISTS(SELECT 1 FROM DELETED)\r\n BEGIN\r\n\t--\r\n\t-- tPicklisteStatus entfernen\r\n\t--\t\t\t\t\t\r\n\t\tDELETE tPicklisteStatus WITH(ROWLOCK)\r\n\t\tFROM tPicklisteStatus WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON tPicklisteStatus.kPickliste = DELETED.kPickliste\r\n\t\t\t\t\t\t\r\n\t--\r\n\t-- tPicklisteVorlage entfernen\r\n\t--\r\n\t\tDELETE tPicklisteVorlage WITH(ROWLOCK)\r\n\t\tFROM tPicklisteVorlage WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON tPicklisteVorlage.kPickliste = DELETED.kPickliste\r\n\t\t\r\n\t--\r\n\t-- tBestellungPicklisteLock entfernen\r\n\t--\r\n\t\tDELETE tBestellungPicklisteLock WITH(ROWLOCK)\r\n\t\tFROM tBestellungPicklisteLock WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON tBestellungPicklisteLock.kPickliste = DELETED.kPickliste\r\n\t\t\r\n\t--\r\n\t-- tPicklistePos entfernen\r\n\t--\r\n\t\tDELETE tPicklistePos WITH(ROWLOCK)\r\n\t\tFROM tPicklistePos WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON tPicklistePos.kPickliste = DELETED.kPickliste\r\n\r\n\r\n\t--\r\n\t-- tWMSbyLight entfernen\r\n\t--\r\n\t\tDELETE tWMSbyLight \r\n\t\tFROM dbo.tWMSbyLight \r\n\t\tJOIN DELETED ON tWMSbyLight.kPickliste = DELETED.kPickliste\r\n END\t\t\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"triggerName": "jtlActionValidator_tPicklistePos",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "--\r\n-- CleanUp-Trigger für das Löschen von PicklistenPositionen\r\n--\r\n\tCREATE TRIGGER [dbo].[jtlActionValidator_tPicklistePos]\r\n\tON [dbo].[tPicklistePos]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\t IF EXISTS(SELECT 1 FROM DELETED)\r\n\t BEGIN\r\n\t\t--\r\n\t\t-- tPicklistePos entfernen\r\n\t\t--\r\n\t\t\tDELETE tPicklistePosStatus WITH(ROWLOCK)\r\n\t\t\tFROM tPicklistePosStatus WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tPicklistePosStatus.kPicklistePos = DELETED.kPicklistePos\r\n\t\t\r\n\t\tEND\r\n\tEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"triggerName": "tgr_tPicklistePos_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPicklistePos_DELETE]\r\nON [dbo].[tPicklistePos]\r\nAFTER DELETE\r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN TRANSACTION\r\n\tDECLARE @kPickliste INT;\r\n\tDECLARE @nStatus INT;\r\n\tDECLARE @kPicklisteStatus INT;\r\n\r\n\tIF EXISTS(SELECT 1 FROM DELETED)\r\n\tBEGIN\r\n\t\tSET CONTEXT_INFO 0x5095;\r\n\t\tUPDATE tWarenLagerEingang\r\n\t\tSET fAnzahlReserviertPickpos = (SELECT ISNULL(SUM(fAnzahl),0)\r\n\t\t\t\t\t\t\t\t\t\tFROM tPicklistePos\r\n\t\t\t\t\t\t\t\t\t\tWHERE tPicklistePos.nStatus < 40\r\n\t\t\t\t\t\t\t\t\t\tAND ISNULL(tPicklistePos.nVorreserviert,0) = 0 \r\n\t\t\t\t\t\t\t\t\t\tAND tPicklistePos.kWarenLagerEingang = tWarenLagerEingang.kWarenLagerEingang)\r\n\t\tWHERE kWarenLagerEingang IN (SELECT kWarenLagerEingang FROM DELETED)\r\n\t\tSET CONTEXT_INFO 0x000;\r\n\r\n\t\t--\r\n\t\t--Hiermit wird sichergestellt, dass aus Versandboxen wieder freigegeben werden, wenn die letzte Position einer Pickpos gelöscht wird\r\n\t\t--\r\n\t\tIF(object_id('tempdb..#LeereBoxen') IS NOT NULL)\r\n\t BEGIN\r\n\t DROP TABLE #LeereBoxen;\r\n\t END\r\n CREATE TABLE #LeereBoxen (klhm INT NOT NULL);\r\n\r\n\t\tINSERT INTO #LeereBoxen (klhm) \r\n\t\tSELECT tlhmstatus.klhm\r\n\t\tFROM tlhmstatus\r\n\t\t\tJOIN tlhm on tlhm.klhmstatus = tlhmstatus.klhmstatus\r\n\t\tWHERE kBestellung IS NOT NULL\r\n\t\t\tAND kBestellung > 0\r\n \t\t\tAND kLhmTyp = 4\r\n\t\t\tAND NOT EXISTS (SELECT *\r\n\t\t\t \t\t\t\tFROM twarenlagereingang\r\n\t\t\t\t\t\t\tWHERE twarenlagereingang.fanzahlaktuell > 0\r\n\t\t\t\t\t\t\tAND twarenlagereingang.klhm = tlhm.klhm)\r\n\t\t\tAND NOT EXISTS (SELECT *\r\n\t\t\t\t\t\t\tFROM tpicklistepos \r\n\t\t\t\t\t\t\tJOIN Verkauf.vAuftragPosition ON tPicklistePos.kBestellPos = vAuftragPosition.kAuftragPosition\r\n\t\t\t\t\t\t\tWHERE vAuftragPosition.kAuftrag = tlhmstatus.kBestellung\r\n\t\t\t\t\t\t\tAND tpicklistepos.nStatus <= 20) --Es müssen nur die Positionen beachtet werden, die auf dem Weg zu einer Box sind\r\n\r\n\t\tDECLARE @dZeitstempel DATETIME = GETDATE()\r\n\t\tINSERT INTO dbo.tLHMStatus (kLHM, nStatus, dZeitstempel, kBestellung) \r\n\t\tSELECT kLHM, 10, @dZeitstempel, 0\r\n\t\tFROM #LeereBoxen\r\n\r\n\t\tUPDATE dbo.tlhm \r\n\t\tSET kLHMStatus = LastStatus.LastkLHMStatus\r\n\t\tFROM #LeereBoxen\r\n\t\tCROSS APPLY (\r\n\t\t\tSELECT MAX(kLHMStatus) AS LastkLHMStatus, tLHMStatus.kLHM\r\n\t\t\tFROM tLHMStatus \r\n\t\t\tWHERE tLHMStatus.kLHM = #LeereBoxen.klhm AND nStatus = 10 AND kBestellung = 0 AND dZeitstempel = @dZeitstempel\r\n\t\t\tGROUP BY tLHMStatus.kLHM) AS LastStatus\r\n\t\tWHERE tlhm.kLHM = LastStatus.kLHM\r\n\t\t\t\t\r\n\t\t--\r\n\t\t--Pickliste wird gelöscht wenn letzte Position gelöscht\r\n\t\t--\r\n\t\tDELETE tPickliste WITH (ROWLOCK)\r\n\t\tFROM tPickliste WITH (ROWLOCK)\r\n\t\tJOIN deleted ON tPickliste.kPickliste = deleted.kPickliste\r\n\t\tLEFT JOIN tPicklistePos ON tPickliste.kPickliste = tPicklistePos.kPickliste\r\n\t\tWHERE tPicklistePos.kPickliste IS NULL\r\n\r\n\t\t\r\n\t IF(object_id('tempdb..#NewStatus') IS NOT NULL)\r\n\t BEGIN\r\n\t DROP TABLE #NewStatus;\r\n\t END\r\n CREATE TABLE #NewStatus (kPicklisteStatus INT NOT NULL, kPickliste INT NOT NULL, nStatus INT NOT NULL);\r\n\r\n\r\n\t --\r\n\t -- Setzt den PicklisteStatus anhand der PicklistePosStatus\r\n\t -- \r\n\t INSERT INTO dbo.tPicklisteStatus\r\n\t\t(\r\n\t\t\tdbo.tPicklisteStatus.kPickliste,\r\n\t\t\tdbo.tPicklisteStatus.kBenutzer,\r\n\t\t\tdbo.tPicklisteStatus.dZeitstempel,\r\n\t\t\tdbo.tPicklisteStatus.nStatus\r\n\t\t)\r\n\t\tOUTPUT INSERTED.kPicklisteStatus, INSERTED.kPickliste, INSERTED.nStatus INTO #NewStatus\r\n\t\tSELECT\r\n\t\t\tdbo.tPickliste.kPickliste,\r\n\t\t\tPicklistePosStatus.kBenutzer AS kBenutzer,\r\n\t\t\tGETDATE(),\r\n\t\t\tCASE \r\n\t\t\t\tWHEN (PicklistePosStatus.nMinStatus = 10) AND (PicklistePosStatus.nMaxStatus > 10) THEN 11\r\n\t\t\t\tELSE PicklistePosStatus.nMinStatus\r\n\t\t\tEND \t\t\r\n\t\tFROM dbo.tPickliste\r\n\t\tJOIN tPicklisteStatus ON dbo.tPicklisteStatus.kPicklisteStatus = dbo.tPickliste.kPicklisteStatus\r\n\t\tJOIN (\r\n\t\t\tSELECT \r\n\t\t\t\tdbo.tPicklistePos.kPickliste,MAX(dbo.tPicklistePosStatus.kBenutzer) AS kBenutzer,\r\n\t\t\t\tMAX(ISNULL(dbo.tPicklistePosStatus.nStatus, 0)) AS nMaxStatus,\r\n\t\t\t\tMIN(ISNULL(dbo.tPicklistePosStatus.nStatus, 0)) AS nMinStatus\r\n\t\t\tFROM dbo.tPicklistePosStatus \r\n\t\t\tJOIN dbo.tPicklistePos ON dbo.tPicklistePos.kPicklistePosStatus = tPicklistePosStatus.kPicklistePosStatus\r\n\t\t\tJOIN DELETED ON DELETED.kPickliste = dbo.tPicklistePos.kPickliste\r\n\t\t\tGROUP BY dbo.tPicklistePos.kPickliste\r\n\t\t) AS PicklistePosStatus ON PicklistePosStatus.kPickliste = dbo.tPickliste.kPickliste\r\n\t\tWHERE\r\n\t\t\t -- wenn noch ungepickte Positionen kann Status 'offen' oder 'in bearbeitung' sein\r\n\t\t\t((PicklistePosStatus.nMinStatus = 10 AND tPicklisteStatus.nStatus NOT IN (10,11))\r\n\t\t\tOR (PicklistePosStatus.nMinStatus != 10 AND PicklistePosStatus.nMinStatus <> dbo.tPicklisteStatus.nStatus))\r\n\r\n\r\n\t -- Tabelle tPickliste muß den gleichen status wie der tPicklisteStatus haben\r\n\t\tUPDATE dbo.tPickliste\r\n\t\tSET dbo.tPickliste.nStatus = #NewStatus.nStatus,\r\n\t\t\tdbo.tPickliste.kPicklisteStatus = #NewStatus.kPicklisteStatus\r\n\t\tFROM dbo.tPickliste\r\n\t\tJOIN #NewStatus ON #NewStatus.kPickliste = dbo.tPickliste.kPickliste;\r\n\r\n\t\tDROP TABLE #NewStatus;\r\n\r\n\t\t-- reservierte Seriennummern wieder freigeben\r\n\t\t-- Anmergung: Die funktion ist veraltet. Für Seriennummern 2.0 brauchen wir das nicht, da wir keine Seriennummern an sich reservieren\r\n -- Entfernen wenn Seriennummern 2.0 standard wird\r\n\t\tUPDATE dbo.tlagerartikel\r\n\t\tSET\r\n\t\t\tdbo.tlagerartikel.kPicklistePos = 0,\r\n\t\t\tdbo.tlagerartikel.kBestellPos = 0\r\n\t\tFROM dbo.tlagerartikel\r\n\t\tJOIN DELETED ON DELETED.kPicklistePos = dbo.tlagerartikel.kPicklistePos\r\n\t\tWHERE dbo.tlagerartikel.kLieferscheinPos = 0;\r\n\t \r\n\t \r\n\t \r\n\t \r\n\tEND\r\n COMMIT\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"triggerName": "tgr_tPicklistePos_INSERT",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPicklistePos_INSERT] \r\nON [dbo].[tPicklistePos] \r\nAFTER INSERT \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF; \r\nBEGIN \r\n\tIF(EXISTS(SELECT * FROM INSERTED WHERE INSERTED.kWarenLagerEingang > 0)) \t \r\n\tBEGIN\r\n\t\tSET CONTEXT_INFO 0x5093;\r\n\t\tUPDATE dbo.tWarenLagerEingang WITH(ROWLOCK) \r\n\t\t\tSET fAnzahlReserviertPickpos = \r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT SUM(ISNULL(dbo.tPicklistePos.fAnzahl,0)) \r\n\t\t\t\t\tFROM dbo.tPicklistePos WITH(NOLOCK)\r\n\t\t\t\t\tJOIN dbo.tPickliste ON tPickliste.kPickliste = tPicklistePos.kPickliste\r\n\t\t\t\t\tWHERE ISNULL(dbo.tPicklistePos.nStatus, 0) < 40 \r\n\t\t\t\t\tAND ISNULL(tPicklistePos.nVorreserviert,0) = 0 \r\n\t\t\t\t\tAND\tdbo.tPicklistePos.kWarenLagerEingang = dbo.tWarenLagerEingang.kWarenLagerEingang\r\n\t\t\t\t) \r\n\t\tFROM dbo.tWarenLagerEingang WITH(ROWLOCK)\r\n\t\tJOIN INSERTED ON dbo.tWarenLagerEingang.kWarenLagerEingang = INSERTED.kWarenLagerEingang;\r\n\t\tSET CONTEXT_INFO 0x000;\r\n\tEND\r\n\r\n\t--\r\n\t-- Kundenhistorie schreiben\r\n\t--\r\n\tINSERT INTO Kunde.tHistorie (kKunde,\r\n\t\t\t\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\t\t\t\tkVorgang,\r\n\t\t\t\t\t\t\t\tkKey,\r\n\t\t\t\t\t\t\t\tcValue1,\r\n\t\t\t\t\t\t\t\tcValue2,\r\n\t\t\t\t\t\t\t\tcValue3,\r\n\t\t\t\t\t\t\t\tdErstellt,\r\n\t\t\t\t\t\t\t\tkBenutzer)\r\n\tSELECT\tDISTINCT vAuftrag.kKunde AS tKunde_kKunde,\r\n\t\t\tInserted.kBestellung,\r\n\t\t\t22,\r\n\t\t\tInserted.kPickliste,\r\n\t\t\tInserted.kPickliste,\r\n\t\t\tvAuftrag.cAuftragsNr AS cBestellNr,\r\n\t\t\tNULL,\r\n\t\t\tGETDATE(),\r\n\t\t\tNULL\r\n\tFROM Inserted\r\n\tJOIN Verkauf.vAuftrag ON vAuftrag.kAuftrag = Inserted.kBestellung\r\n\tJOIN dbo.tWarenlager ON tWarenLager.kWarenLager = Inserted.kWarenLager\r\n\tWHERE Inserted.kBestellung NOT IN (SELECT kBestellung FROM dbo.tPicklistePos WHERE tPicklistePos.kPicklistePos <> Inserted.kPicklistePos)\r\n\t\tAND tWarenlager.nLagerplatzVerwaltung = 1\r\n\t\tAND vAuftrag.nType != 2\r\n\t\tAND vAuftrag.kKunde IS NOT NULL;\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPicklistePos",
|
|
"triggerName": "tgr_tPicklistePos_UPDATE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPicklistePos_UPDATE] \r\nON [dbo].[tPicklistePos] \r\nAFTER UPDATE \r\nAS \r\nSET NOCOUNT ON; \r\nBEGIN \r\n --\r\n -- Wird nur ausgeführt wenn die fAnzahl sich ändert\r\n --\r\n\tIF((SELECT COUNT(*) FROM INSERTED \r\n\t FULL JOIN DELETED ON INSERTED.kPicklistePos = DELETED.kPicklistePos\r\n\t WHERE INSERTED.fAnzahl != DELETED.fAnzahl OR INSERTED.nStatus = 40 OR INSERTED.kWarenLagerEingang != DELETED.kWarenLagerEingang) > 0)\r\n BEGIN\r\n\t\tSET CONTEXT_INFO 0x5094;\r\n\t\tUPDATE tWarenLagerEingang WITH(ROWLOCK) \r\n\t\t\tSET fAnzahlReserviertPickpos =\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT ISNULL(SUM(ISNULL(fAnzahl,0.0)),0.0) \r\n\t\t\t\t\tFROM tPicklistePos WITH(NOLOCK)\r\n\t\t\t\t\tWHERE ISNULL(tPicklistePos.nStatus,0) < 40 \r\n\t\t\t\t\tAND ISNULL(tPicklistePos.nVorreserviert,0) = 0 \r\n\t\t\t\t AND tPicklistePos.kWarenLagerEingang = tWarenLagerEingang.kWarenLagerEingang\r\n\t\t\t\t) \r\n\t\tFROM tWarenLagerEingang WITH(ROWLOCK)\r\n\t\tJOIN \r\n\t\t(\r\n\t\t\tSELECT kWarenLagerEingang\r\n\t\t\tFROM INSERTED\r\n\t\t\tGROUP BY kWarenLagerEingang\r\n\t\t\tUNION ALL\r\n\t\t\tSELECT kWarenLagerEingang\r\n\t\t\tFROM DELETED\r\n\t\t\tGROUP BY kWarenLagerEingang\r\n\t\t) AS BetroffeneDatensatze ON tWarenLagerEingang.kWarenLagerEingang = BetroffeneDatensatze.kWarenLagerEingang\r\n\t\tSET CONTEXT_INFO 0x000;\r\n END\r\n\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"triggerName": "jtlActionValidator_tPreis",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tPreis] \r\nON [dbo].[tPreis] \r\nAFTER DELETE \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN \r\n\r\n\t--\r\n\t--Überprüfen ob Trigger mit Inhalt aufgerufen wird\r\n\t--\r\n\t\tIF((SELECT COUNT(1) FROM DELETED) = 0)\r\n\t\tBEGIN\r\n\t\t\tRETURN\r\n\t\tEND\r\n\r\n\t--\r\n\t-- tPreisDetail aufräumen\r\n\t--\r\n\t\tDELETE dbo.tPreisDetail WITH(ROWLOCK)\r\n\t\tFROM dbo.tPreisDetail WITH(ROWLOCK)\r\n\t\tJOIN DELETED ON DELETED.kPreis = dbo.tPreisDetail.kPreis \r\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"triggerName": "tgr_tPreis_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPreis_DEL]\r\nON [dbo].[tPreis]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtPreisDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtPreisDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtPreisDel\r\n\t(\r\n\t\tkArtikel INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtPreisDel (kArtikel)\r\n\t\tSELECT\r\n\t\t\tDeleted.kArtikel\r\n\t\tFROM Deleted;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtPreisDel ON #tgrtPreisDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nSyncType = 4\r\n\t\tAND tEntityTracking.nEntityType = 1;\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 2,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtPreisDel ON #tgrtPreisDel.kArtikel = tArtikelShop.kArtikel\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,1,4,5,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreis",
|
|
"triggerName": "tgr_tPreis_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPreis_INSUP]\r\nON [dbo].[tPreis]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF (NOT (UPDATE(kArtikel) OR UPDATE(kKundenGruppe) OR UPDATE(kShop) OR UPDATE(kKunde)))\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtPreisInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtPreisInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtPreisInsup\r\n\t(\r\n\t\tkPreis INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkKunde INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnInserted BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtPreisInsup (kPreis, kArtikel, kKunde, nPosBlock, nInserted)\r\n\t\tSELECT\r\n\t\t\tInserted.kPreis,\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tInserted.kKunde,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.kArtikel, Inserted.kKundenGruppe, Inserted.kShop, Inserted.kKunde\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.kArtikel, Deleted.kKundenGruppe, Deleted.kShop, Deleted.kKunde\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kPreis EXCEPT SELECT Deleted.kPreis) THEN 1 ELSE 0 END AS nInserted\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kPreis = Inserted.kPreis;\r\n\r\n\tIF (UPDATE(kArtikel) OR UPDATE(kKundenGruppe) OR UPDATE(kShop) OR UPDATE(kKunde))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\t\t\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtPreisInsup WHERE #tgrtPreisInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking \r\n\t\t\tJOIN #tgrtPreisInsup ON #tgrtPreisInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\tWHERE #tgrtPreisInsup.nPosBlock = 1\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4;\r\n\t\tEND\r\n\tEND\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtPreisInsup WHERE #tgrtPreisInsup.nInserted = 1)\r\n\tBEGIN\r\n\t\tDECLARE @kunde AS TYPE_spkundeUpdate;\r\n\t\tINSERT INTO @kunde (kKunde, cKassenKunde, xFlag_cKassenKunde)\r\n\t\t\tSELECT\r\n\t\t\t\t#tgrtPreisInsup.kKunde,\r\n\t\t\t\t'Y' AS cKassenKunde,\r\n\t\t\t\t1 AS xFlag_cKassenKunde\r\n\t\t\tFROM #tgrtPreisInsup\r\n\t\t\tWHERE #tgrtPreisInsup.nInserted = 1\r\n\r\n\t\tEXEC Kunde.spKundeUpdate\r\n\t\t\t@Daten = @kunde,\r\n\t\t\t@kBenutzer = 0;\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreisDetail",
|
|
"triggerName": "tgr_tPreisDetail_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPreisDetail_DEL]\r\nON [dbo].[tPreisDetail]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtPreisDetailDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtPreisDetailDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtPreisDetailDel\r\n\t(\r\n\t\tkPreis INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkKundenGruppe INT NOT NULL,\r\n\t\tkShop INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtPreisDetailDel (kPreis, kArtikel, kKundenGruppe, kShop)\r\n\t\tSELECT\r\n\t\t\tDeleted.kPreis,\r\n\t\t\ttPreis.kArtikel,\r\n\t\t\ttPreis.kKundenGruppe,\r\n\t\t\ttPreis.kShop\r\n\t\tFROM Deleted\r\n\t\tJOIN dbo.tPreis ON tPreis.kPreis = Deleted.kPreis;\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tUPDATE Sync.tEntityTracking\r\n\tSET tEntityTracking.dLastModified = GETDATE()\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtPreisDetailDel ON #tgrtPreisDetailDel.kArtikel = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 1\r\n\t\tAND tEntityTracking.nSyncType = 4;\r\n\r\n\t--\r\n -- Amazon\r\n --\r\n -- Preise in pf_amazon_angebot_ext aktualisieren, falls es sich um B2B-Preise handelt mit \r\n -- passendem Artikel und Kundengruppe.\r\n -- Der wirklich zu sendende Preis wird dann im Abgleich selber berechnet.\r\n UPDATE dbo.pf_amazon_angebot_ext\r\n SET fPreis = pf_amazon_angebot.fPrice\r\n FROM dbo.pf_amazon_angebot_ext \r\n JOIN dbo.pf_amazon_angebot ON pf_amazon_angebot.cSellerSKU = pf_amazon_angebot_ext.cSellerSKU \r\n\t\tAND pf_amazon_angebot.kUser = pf_amazon_angebot_ext.kUser \r\n\t\tAND pf_amazon_angebot.nPlattform = pf_amazon_angebot_ext.nPlattform\r\n JOIN Amazon.tPreiskonfiguration ON tPreiskonfiguration.kUser = pf_amazon_angebot.kUser\r\n\t\tAND tPreiskonfiguration.kPlattform = pf_amazon_angebot.nPlattform\r\n JOIN #tgrtPreisDetailDel ON #tgrtPreisDetailDel.kKundenGruppe = tPreiskonfiguration.kKundengruppe\r\n JOIN dbo.pf_amazon_angebot_mapping ON pf_amazon_angebot_mapping.kArtikel = #tgrtPreisDetailDel.kArtikel\r\n\t\tAND pf_amazon_angebot_mapping.kUser = pf_amazon_angebot.kUser\r\n WHERE pf_amazon_angebot_ext.nB2BPreiseSenden = 1 \r\n\t\tAND pf_amazon_angebot_ext.fPreis IS NULL\r\n\r\n\t--\r\n\t-- Connector\r\n\t--\r\n\t--\r\n\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t--\r\n\tUPDATE dbo.tArtikelShop\r\n\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 2,\r\n\t\ttArtikelShop.cInet = 'Y',\r\n\t\ttArtikelShop.nInBearbeitung = 0\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN #tgrtPreisDetailDel ON #tgrtPreisDetailDel.kArtikel = tArtikelShop.kArtikel\r\n\t\tAND (#tgrtPreisDetailDel.kShop = tArtikelShop.kShop OR #tgrtPreisDetailDel.kShop = 0)\r\n\tWHERE tArtikelShop.cInet = 'N'\r\n\t\tOR tArtikelShop.nAktion IN (0,1,4,5,8)\r\n\t\tOR tArtikelShop.nInBearbeitung = 1;\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tPreisDetail",
|
|
"triggerName": "tgr_tPreisDetail_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tPreisDetail_INSUP]\r\nON [dbo].[tPreisDetail]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtPreisDetailInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtPreisDetailInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtPreisDetailInsup\r\n\t(\r\n\t\tkPreis INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkKundenGruppe INT NOT NULL,\r\n\t\tkShop INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtPreisDetailInsup (kPreis, kArtikel, kKundenGruppe, kShop, nPosBlock)\r\n\t\tSELECT\r\n\t\t\tInserted.kPreis,\r\n\t\t\ttPreis.kArtikel,\r\n\t\t\ttPreis.kKundenGruppe,\r\n\t\t\ttPreis.kShop,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.kPreis, Inserted.nAnzahlAb, Inserted.fNettoPreis, Inserted.fProzent\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.kPreis, Deleted.nAnzahlAb, Deleted.fNettoPreis, Deleted.fProzent\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kPreis = Inserted.kPreis\r\n\t\t\tAND Deleted.nAnzahlAb = Inserted.nAnzahlAb\r\n\t\tJOIN dbo.tPreis ON tPreis.kPreis = Inserted.kPreis;\r\n\r\n\tIF (UPDATE(kPreis) OR UPDATE(nAnzahlAb) OR UPDATE(fNettoPreis) OR UPDATE(fProzent))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtPreisDetailInsup WHERE #tgrtPreisDetailInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtPreisDetailInsup ON #tgrtPreisDetailInsup.kArtikel = tEntityTracking.kEntityId\r\n\t\t\t\tAND tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\t\tWHERE #tgrtPreisDetailInsup.nPosBlock = 1;\r\n\r\n\t\t\t--\r\n\t\t\t-- Connector\r\n\t\t\t--\r\n\t\t\t--\r\n\t\t\t-- Artikel vollständig zu Webshops senden, wenn Änderungen vorgenommen wurden\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET tArtikelShop.nAktion = tArtikelShop.nAktion | 2,\r\n\t\t\t\ttArtikelShop.cInet = 'Y',\r\n\t\t\t\ttArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN #tgrtPreisDetailInsup ON #tgrtPreisDetailInsup.kArtikel = tArtikelShop.kArtikel\r\n\t\t\t\tAND (#tgrtPreisDetailInsup.kShop = tArtikelShop.kShop OR #tgrtPreisDetailInsup.kShop = 0)\r\n\t\t\t\tAND #tgrtPreisDetailInsup.nPosBlock = 1\r\n\t\t\tWHERE tArtikelShop.cInet = 'N'\r\n\t\t\t\tOR tArtikelShop.nAktion IN (0,1,4,5,8)\r\n\t\t\t\tOR tArtikelShop.nInBearbeitung = 1;\r\n\t\tEND\r\n\tEND\r\n\r\n\t--\r\n -- Amazon\r\n --\r\n -- Preise in pf_amazon_angebot_ext aktualisieren, falls es sich um B2B-Preise handelt mit \r\n -- passendem Artikel und Kundengruppe.\r\n -- Der wirklich zu sendende Preis wird dann im Abgleich selber berechnet.\r\n UPDATE dbo.pf_amazon_angebot_ext\r\n SET fPreis = pf_amazon_angebot.fPrice\r\n FROM dbo.pf_amazon_angebot_ext \r\n JOIN dbo.pf_amazon_angebot ON pf_amazon_angebot.cSellerSKU = pf_amazon_angebot_ext.cSellerSKU \r\n\t\tAND pf_amazon_angebot.kUser = pf_amazon_angebot_ext.kUser \r\n\t\tAND pf_amazon_angebot.nPlattform = pf_amazon_angebot_ext.nPlattform\r\n JOIN Amazon.tPreiskonfiguration ON tPreiskonfiguration.kUser = pf_amazon_angebot.kUser\r\n\t\tAND tPreiskonfiguration.kPlattform = pf_amazon_angebot.nPlattform\r\n JOIN #tgrtPreisDetailInsup ON #tgrtPreisDetailInsup.kKundenGruppe = tPreiskonfiguration.kKundengruppe\r\n JOIN dbo.pf_amazon_angebot_mapping ON pf_amazon_angebot_mapping.kArtikel = #tgrtPreisDetailInsup.kArtikel\r\n\t\tAND pf_amazon_angebot_mapping.kUser = pf_amazon_angebot.kUser\r\n\t\tAND pf_amazon_angebot_mapping.cSellerSKU = pf_amazon_angebot.cSellerSKU \r\n\t\tAND pf_amazon_angebot_mapping.cSellerSKU = pf_amazon_angebot_ext.cSellerSKU\r\n WHERE pf_amazon_angebot_ext.nB2BPreiseSenden = 1 \r\n\t\tAND pf_amazon_angebot_ext.fPreis IS NULL\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tShop",
|
|
"triggerName": "jtlActionValidator_tShop",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tShop] \r\nON [dbo].[tShop] \r\nAFTER DELETE \r\nAS \r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN \r\n\t--\r\n\t--Überprüfen ob Trigger mit Inhalt aufgerufen wird\r\n\t--\r\n\tIF((SELECT COUNT(1) FROM DELETED) = 0)\r\n\tBEGIN\r\n\t\tRETURN;\r\n\tEND;\r\n\r\n\t--\r\n\t-- tArtikelAttribut aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelAttribut\r\n\tFROM dbo.tArtikelAttribut\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelAttribut.kShop;\r\n\r\n\t--\r\n\t-- tArtikelBeschreibung aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelBeschreibung\r\n\tFROM dbo.tArtikelBeschreibung\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelBeschreibung.kShop;\r\n\r\n\t--\r\n\t-- tArtikelbildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelbildPlattform\r\n\tFROM dbo.tArtikelbildPlattform\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelbildPlattform.kShop;\r\n\r\n\t--\r\n\t-- tArtikelRankingGlobal aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelRankingGlobal\r\n\tFROM dbo.tArtikelRankingGlobal\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelRankingGlobal.kShop;\r\n\r\n\t--\r\n\t-- tArtikelRankingZeitraum aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelRankingZeitraum\r\n\tFROM dbo.tArtikelRankingZeitraum\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelRankingZeitraum.kShop;\r\n\r\n\t--\r\n\t-- tArtikelShop aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelShop\r\n\tFROM dbo.tArtikelShop\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelShop.kShop;\r\n\r\n\t--\r\n\t-- tArtikelSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tArtikelSichtbarkeit\r\n\tFROM dbo.tArtikelSichtbarkeit\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tArtikelSichtbarkeit.kShop;\r\n\r\n\t--\r\n\t-- tAttributShop aufräumen\r\n\t--\r\n\tDELETE dbo.tAttributShop\r\n\tFROM dbo.tAttributShop\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tAttributShop.kShop;\r\n\r\n\t--\r\n\t-- tbestellung aufräumen\r\n\t--\r\n\tDECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'jtlActionValidator_tShop');\r\n\tSET CONTEXT_INFO @hash;\r\n\r\n\tUPDATE Verkauf.tAuftrag\r\n\t\tSET tAuftrag.kShop = NULL\r\n\tFROM Verkauf.tAuftrag\r\n\tJOIN DELETED ON DELETED.kShop = tAuftrag.kShop;\r\n\r\n\tSET CONTEXT_INFO @OldContextInfo;\r\n\r\n\t--\r\n\t-- tDownloadShop aufräumen\r\n\t--\r\n\tDELETE dbo.tDownloadShop\r\n\tFROM dbo.tDownloadShop\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tDownloadShop.kShop;\r\n\r\n\t--\r\n\t-- tEigenschaftSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tEigenschaftSichtbarkeit\r\n\tFROM dbo.tEigenschaftSichtbarkeit\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tEigenschaftSichtbarkeit.kShop;\r\n\r\n\r\n --\r\n\t-- tEigenschaftWertAufpreis aufräumen\r\n\t--\r\n\tDELETE dbo.tEigenschaftWertAufpreis\r\n\tFROM dbo.tEigenschaftWertAufpreis\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tEigenschaftWertAufpreis.kShop;\r\n\t \r\n\r\n\t--\r\n\t-- tEigenschaftWertSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tEigenschaftWertSichtbarkeit\r\n\tFROM dbo.tEigenschaftWertSichtbarkeit\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tEigenschaftWertSichtbarkeit.kShop;\r\n\r\n\t \r\n --\r\n\t-- tGlobalsQueue aufräumen\r\n\t--\r\n\tDELETE dbo.tGlobalsQueue \r\n\tFROM dbo.tGlobalsQueue \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tGlobalsQueue.kShop;\r\n\r\n\r\n\t--\r\n\t-- tGutschein aufräumen\r\n\t--\r\n\tUPDATE dbo.tGutschein \r\n\tSET dbo.tGutschein.kShop = 0\r\n\tFROM dbo.tGutschein \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tGutschein.kShop;\r\n\r\n\t--\r\n\t-- tHerstellerBildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tHerstellerBildPlattform \r\n\tFROM dbo.tHerstellerBildPlattform \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tHerstellerBildPlattform.kShop;\r\n\r\n\t--\r\n\t-- tinetadress aufräumen\r\n\t--\r\n\tDELETE dbo.tinetadress \r\n\tFROM dbo.tinetadress \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetadress.kShop;\r\n\r\n\t--\r\n\t-- tInetAdresseShop aufräumen\r\n\t--\r\n\tDELETE dbo.tInetAdresseShop \r\n\tFROM dbo.tInetAdresseShop \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tInetAdresseShop.kShop;\r\n\r\n\r\n\t--\r\n\t-- tinetbestellpos aufräumen\r\n\t--\r\n\tDELETE dbo.tinetbestellpos\r\n\tFROM dbo.tinetbestellpos \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetbestellpos.kShop;\r\n\r\n\t--\r\n\t-- tinetbestellposeigenschaft aufräumen\r\n\t--\r\n\tDELETE dbo.tinetbestellposeigenschaft\r\n\tFROM dbo.tinetbestellposeigenschaft \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetbestellposeigenschaft.kShop;\r\n\r\n\r\n\t--\r\n\t-- tinetbestellung aufräumen\r\n\t--\r\n\tDELETE dbo.tinetbestellung \r\n\tFROM dbo.tinetbestellung \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetbestellung.kShop;\r\n\r\n\t--\r\n\t-- tShopKundenGruppe aufräumen\r\n\t--\r\n\tDELETE dbo.tShopKundenGruppe \r\n\tFROM dbo.tShopKundenGruppe \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopKundenGruppe.kWebShop;\r\n\r\n\t--\r\n\t-- tShopSprache aufräumen\r\n\t--\r\n\tDELETE dbo.tShopSprache \r\n\tFROM dbo.tShopSprache \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopSprache.kWebShop;\r\n\r\n\t--\r\n\t-- tinetkunde aufräumen\r\n\t--\r\n\tDELETE dbo.tinetkunde \r\n\tFROM dbo.tinetkunde \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetkunde.kShop;\r\n\r\n\r\n\t--\r\n\t-- tInetKundenAttribute aufräumen\r\n\t--\r\n\tDELETE dbo.tInetKundenAttribute \r\n\tFROM dbo.tInetKundenAttribute \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tInetKundenAttribute.kShop;\r\n\r\n\r\n\t--\r\n\t-- tInetKundeShop aufräumen\r\n\t--\r\n\tDELETE dbo.tInetKundeShop \r\n\tFROM dbo.tInetKundeShop \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tInetKundeShop.kShop;\r\n\r\n\r\n\t--\r\n\t-- tInetShopZahlung aufräumen\r\n\t--\r\n\tDELETE dbo.tInetShopZahlung \r\n\tFROM dbo.tInetShopZahlung \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tInetShopZahlung.kShop;\r\n\r\n\r\n\t--\r\n\t-- tinetzahlungsinfo aufräumen\r\n\t--\r\n\tDELETE dbo.tinetzahlungsinfo \r\n\tFROM dbo.tinetzahlungsinfo \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tinetzahlungsinfo.kShop;\r\n\r\n\r\n\t--\r\n\t-- tKategorieAttribut aufräumen\r\n\t--\r\n\tDELETE dbo.tKategorieAttribut \r\n\tFROM dbo.tKategorieAttribut \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategorieAttribut.kShop;\r\n\r\n\r\n\t--\r\n\t-- tKategoriebildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tKategoriebildPlattform \r\n\tFROM dbo.tKategoriebildPlattform \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategoriebildPlattform.kShop;\r\n\r\n\r\n\t--\r\n\t-- tKategorieRabatt aufräumen\r\n\t--\r\n\tDELETE dbo.tKategorieRabatt \r\n\tFROM dbo.tKategorieRabatt \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategorieRabatt.kShop;\r\n\r\n\t--\r\n\t-- tKategorieShop aufräumen\r\n\t--\r\n\tDELETE dbo.tKategorieShop \r\n\tFROM dbo.tKategorieShop \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategorieShop.kShop;\r\n\r\n\t--\r\n\t-- tKategorieSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tKategorieSichtbarkeit \r\n\tFROM dbo.tKategorieSichtbarkeit \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategorieSichtbarkeit.kShop;\r\n\r\n\t--\r\n\t-- tKategorieSichtbarkeit aufräumen\r\n\t--\r\n\tDELETE dbo.tKategorieSprache \r\n\tFROM dbo.tKategorieSprache \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKategorieSprache.kShop;\r\n\r\n\t--\r\n\t-- tkonfigitempreis aufräumen\r\n\t--\r\n\tDELETE dbo.tkonfigitempreis \r\n\tFROM dbo.tkonfigitempreis \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tkonfigitempreis.kShop;\r\n\r\n\t\r\n\t--\r\n\t-- tkonfigshop aufräumen\r\n\t--\r\n\tDELETE dbo.tkonfigshop \r\n\tFROM dbo.tkonfigshop \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tkonfigshop.kShop;\r\n\r\n\t--\r\n\t-- tKundenRankingGlobal aufräumen\r\n\t--\r\n\tDELETE dbo.tKundenRankingGlobal \r\n\tFROM dbo.tKundenRankingGlobal \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKundenRankingGlobal.kShop;\r\n\r\n\t--\r\n\t-- tKundenRankingZeitraum aufräumen\r\n\t--\r\n\tDELETE dbo.tKundenRankingZeitraum \r\n\tFROM dbo.tKundenRankingZeitraum \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tKundenRankingZeitraum.kShop;\r\n\r\n\t--\r\n\t-- tMedienDateiShop aufräumen\r\n\t--\r\n\tDELETE dbo.tMedienDateiShop \r\n\tFROM dbo.tMedienDateiShop \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tMedienDateiShop.kShop;\r\n\r\n\t--\r\n\t-- tMedienDir aufräumen\r\n\t--\r\n\tDELETE dbo.tMedienDir \r\n\tFROM dbo.tMedienDir \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tMedienDir.kShop;\r\n\r\n\t--\r\n\t-- tMedienFile aufräumen\r\n\t--\r\n\tDELETE dbo.tMedienFile \r\n\tFROM dbo.tMedienFile \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tMedienFile.kShop;\r\n\r\n\t--\r\n\t-- tMerkmalBildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tMerkmalBildPlattform \r\n\tFROM dbo.tMerkmalBildPlattform \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tMerkmalBildPlattform.kShop;\r\n\r\n\t--\r\n\t-- tMerkmalwertBildPlattform aufräumen\r\n\t--\r\n\tDELETE dbo.tMerkmalwertBildPlattform \r\n\tFROM dbo.tMerkmalwertBildPlattform \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tMerkmalwertBildPlattform.kShop;\r\n\r\n\t--\r\n\t-- tPicVersand aufräumen\r\n\t--\r\n\tDELETE dbo.tPicVersand \r\n\tFROM dbo.tPicVersand \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tPicVersand.kShop;\r\n\r\n\t--\r\n\t-- tPreis aufräumen\r\n\t--\r\n\tDELETE dbo.tPreis \r\n\tFROM dbo.tPreis \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tPreis.kShop;\r\n\r\n\t--\r\n\t-- tPreiskalkulationSetting aufräumen\r\n\t--\r\n\tDELETE dbo.tPreiskalkulationSetting \r\n\tFROM dbo.tPreiskalkulationSetting \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tPreiskalkulationSetting.kShop;\r\n\r\n\t--\r\n\t-- tQueue aufräumen\r\n\t--\r\n\tDELETE dbo.tQueue \r\n\tFROM dbo.tQueue \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tQueue.kShop;\r\n\r\n\t--\r\n\t-- tSonderpreise aufräumen\r\n\t--\r\n\tDELETE dbo.tSonderpreise \r\n\tFROM dbo.tSonderpreise \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tSonderpreise.kShop;\r\n\r\n\t--\r\n\t-- tVerfuegbarkeitsAnfrage aufräumen\r\n\t--\r\n\tDELETE dbo.tVerfuegbarkeitsAnfrage \r\n\tFROM dbo.tVerfuegbarkeitsAnfrage \r\n\tJOIN DELETED ON DELETED.kShop = dbo.tVerfuegbarkeitsAnfrage.kShop;\r\n\r\n\t--\r\n\t-- Connector-Tabellen aufräumen\r\n\t--\r\n\tDELETE dbo.tShopKonfiguration\r\n\tFROM dbo.tShopKonfiguration\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopKonfiguration.kShop;\r\n\r\n\tDELETE dbo.tShopConnectorFunktion\r\n\tFROM dbo.tShopConnectorFunktion\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopConnectorFunktion.kShop;\r\n\r\n\tDELETE dbo.tShopConnectorSynchronisierung\r\n\tFROM dbo.tShopConnectorSynchronisierung\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopConnectorSynchronisierung.kShop;\r\n\r\n\tDELETE dbo.tShopMappingKundengruppe\r\n\tFROM dbo.tShopMappingKundengruppe\r\n\tJOIN DELETED ON DELETED.kShop = dbo.tShopMappingKundengruppe.kShop;\r\n\r\nEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tShop",
|
|
"triggerName": "tgr_tShop_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tShop_DEL]\r\nON [dbo].[tShop]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Deleted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtShopDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtShopDel;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtShopDel\r\n\t(\r\n\t\tkShop INT NOT NULL,\r\n\t\tnTyp TINYINT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtShopDel (kShop, nTyp)\r\n\t\tSELECT\r\n\t\t\tDeleted.kShop,\r\n\t\t\tDeleted.nTyp\r\n\t\tFROM Deleted;\r\n\t\r\n\t--\r\n\t-- Konfigurationsgruppen\r\n\t--\r\n\tDELETE dbo.tkonfigitempreis\r\n\tFROM dbo.tkonfigitempreis\r\n\tJOIN #tgrtShopDel ON #tgrtShopDel.kShop = tkonfigitempreis.kShop\r\n\r\n\tDELETE dbo.tkonfigshop\r\n\tFROM dbo.tkonfigshop\r\n\tJOIN #tgrtShopDel ON #tgrtShopDel.kShop = tkonfigshop.kShop\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\tDELETE Sync.tEntityPlatform\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN #tgrtShopDel ON #tgrtShopDel.kShop = tEntityPlatform.kShop;\r\n\t\r\n\tIF NOT EXISTS(SELECT TOP(1) 1 FROM Sync.tEntityPlatform\r\n\t\t\t\t\tJOIN dbo.tShop ON tShop.kShop = tEntityPlatform.kShop\r\n\t\t\t\t\tJOIN #tgrtShopDel ON #tgrtShopDel.nTyp = tShop.nTyp)\r\n\tBEGIN\r\n\t\tDELETE Sync.tEntityTracking\r\n\t\tFROM Sync.tEntityTracking\r\n\t\tJOIN #tgrtShopDel ON #tgrtShopDel.nTyp = tEntityTracking.nSyncType\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tShop",
|
|
"triggerName": "tgr_tShop_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tShop_INSUP]\r\nON [dbo].[tShop]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS, ANSI_NULL_DFLT_ON, ANSI_PADDING, CONCAT_NULL_YIELDS_NULL, XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM Inserted) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtShopInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtShopInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtShopInsup\r\n\t(\r\n\t\tkShop INT NOT NULL,\r\n\t\tcApiKey NVARCHAR(64) NULL,\r\n\t\tnTyp TINYINT NOT NULL,\r\n\t\tcName NVARCHAR(255) NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tnInserted BIT NOT NULL,\r\n\t\tnName BIT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtShopInsup (kShop, cApiKey, nTyp, cName, nPosBlock, nName, nInserted)\r\n\t\tSELECT\r\n\t\t\tInserted.kShop,\r\n\t\t\tInserted.cAPIKey,\r\n\t\t\tInserted.nTyp,\r\n\t\t\tInserted.cName,\r\n\t\t\tCASE WHEN EXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\tInserted.kWarenlager, Inserted.kWarenlagerPlatz, Inserted.nWarenlagerPlatztyp\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\tDeleted.kWarenlager, Deleted.kWarenlagerPlatz, Deleted.nWarenlagerPlatztyp\r\n\t\t\t)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.cName EXCEPT SELECT Deleted.cName) THEN 1 ELSE 0 END AS nName,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kShop EXCEPT SELECT Deleted.kShop) THEN 1 ELSE 0 END AS nInserted\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted ON Deleted.kShop = Inserted.kShop;\r\n\r\n\tIF EXISTS (SELECT 1 FROM #tgrtShopInsup WHERE #tgrtShopInsup.nInserted = 1)\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS\r\n\t\t--\t\t\r\n\t\tIF(OBJECT_ID('tempdb..#tgr_tShop_Sync') IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tDROP TABLE #tgr_tShop_Sync;\r\n\t\tEND\r\n\r\n\t\tCREATE TABLE #tgr_tShop_Sync\r\n\t\t(\r\n\t\t\tkId INT,\r\n\t\t\tkShop INT,\r\n\t\t\tnSyncType TINYINT,\r\n\t\t\tnEntityType TINYINT,\r\n\t\t\tkEntityId INT,\r\n\t\t);\r\n\t\r\n\t\tINSERT INTO #tgr_tShop_Sync (kId, kShop, nSyncType, nEntityType, kEntityId)\r\n\t\t\tSELECT\r\n\t\t\t\ttkunde.kKunde,\r\n\t\t\t\t#tgrtShopInsup.kShop,\r\n\t\t\t\t4 AS nSyncType,\r\n\t\t\t\t4 AS nEntityType,\r\n\t\t\t\ttEntityPlatform.kEntityId\r\n\t\t\tFROM dbo.tkunde\r\n\t\t\tCROSS JOIN #tgrtShopInsup\r\n\t\t\tLEFT JOIN Sync.tEntityPlatform ON tEntityPlatform.kShop = #tgrtShopInsup.kShop\r\n\t\t\t\tAND tEntityPlatform.kEntityId = tkunde.kKunde\r\n\t\t\t\tAND tEntityPlatform.nEntityType = 4\r\n\t\t\tWHERE #tgrtShopInsup.nInserted = 1\r\n\t\t\t\tAND #tgrtShopInsup.nTyp = 4\r\n\t\t\t\tAND tkunde.cKassenKunde = 'Y'\r\n\t\t\tGROUP BY tKunde.kKunde, \r\n\t\t\t\t#tgrtShopInsup.kShop,\r\n\t\t\t\t#tgrtShopInsup.nTyp,\r\n\t\t\t\ttEntityPlatform.kEntityId;\r\n\r\n\t\t--\r\n\t\t-- Insert\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tShop_Sync WHERE #tgr_tShop_Sync.kEntityId IS NOT NULL)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityPlatform\r\n\t\t\tSET tEntityPlatform.dActive = GETDATE(),\r\n\t\t\t\ttEntityPlatform.dInactive = NULL\r\n\t\t\tFROM Sync.tEntityPlatform\r\n\t\t\tJOIN #tgr_tShop_Sync ON #tgr_tShop_Sync.kEntityId = tEntityPlatform.kEntityId\r\n\t\t\t\tAND #tgr_tShop_Sync.kShop = tEntityPlatform.kShop\r\n\t\t\t\tAND tEntityPlatform.nEntityType = #tgr_tShop_Sync.nEntityType;\r\n\t\tEND\r\n\r\n\t\tIF EXISTS (SELECT 1 FROM #tgr_tShop_Sync WHERE #tgr_tShop_Sync.kEntityId IS NULL)\r\n\t\tBEGIN\r\n\t\t\tINSERT INTO Sync.tEntityPlatform (kEntityId, nEntityType, kShop, dActive, dInactive)\r\n\t\t\t\tSELECT \r\n\t\t\t\t\t#tgr_tShop_Sync.kId AS kEntityId,\r\n\t\t\t\t\t#tgr_tShop_Sync.nEntityType AS nEntityType,\r\n\t\t\t\t\t#tgr_tShop_Sync.kShop AS kShop,\r\n\t\t\t\t\tGETDATE() AS dActive,\r\n\t\t\t\t\tNULL AS dInactive\r\n\t\t\t\tFROM #tgr_tShop_Sync\r\n\t\t\t\tWHERE #tgr_tShop_Sync.kEntityId IS NULL;\r\n\t\tEND\r\n\r\n\t\t--\r\n\t\t-- Shop\r\n\t\t--\r\n\t\tINSERT INTO dbo.tHerstellerBildPlattform(kHersteller, kPlattform, kShop, kBild, nInet)\r\n\t\t\tSELECT \r\n\t\t\t\ttHersteller.kHersteller, \r\n\t\t\t\t2 AS kPlattform,\r\n\t\t\t\t#tgrtShopInsup.kShop,\r\n\t\t\t\ttHerstellerBildPlattform.kBild, \r\n\t\t\t\t1 AS nInet\r\n\t\t\tFROM #tgrtShopInsup\r\n\t\t\tCROSS JOIN dbo.tHersteller\r\n\t\t\tJOIN dbo.tHerstellerBildPlattform ON tHerstellerBildPlattform.kHersteller = tHersteller.kHersteller\r\n\t\t\t\tAND tHerstellerBildPlattform.kShop = 0\r\n\t\t\tWHERE #tgrtShopInsup.nInserted = 1;\r\n\r\n\t\tINSERT INTO dbo.tShopKundenGruppe(kWebShop, kKundenGruppe, nStandard)\r\n\t\t\tSELECT\r\n\t\t\t\t#tgrtShopInsup.kShop,\r\n\t\t\t\ttKundenGruppe.kKundenGruppe, \r\n\t\t\t\t0 AS nStandard\r\n\t\t\tFROM #tgrtShopInsup\r\n\t\t\tCROSS JOIN dbo.tKundenGruppe\r\n\t\t\tWHERE #tgrtShopInsup.nTyp = 4\r\n\t\t\t\tAND #tgrtShopInsup.nInserted = 1;\r\n\r\n\t\tMERGE dbo.tkonfigshop AS TARGET\r\n\t\tUSING\r\n\t\t(\r\n\t\t\tSELECT\r\n\t\t\t\ttkonfiggruppe.kKonfiggruppe,\r\n\t\t\t\t#tgrtShopInsup.kShop\r\n\t\t\tFROM #tgrtShopInsup \r\n\t\t\tCROSS JOIN dbo.tkonfiggruppe\r\n\t\t\tJOIN dbo.tWebshopModule ON #tgrtShopInsup.cAPIKey = tWebshopModule.cAPIKey\r\n\t\t\tWHERE tWebshopModule.cName = 'Konfigurator'\r\n\t\t\t\tAND #tgrtShopInsup.nInserted = 1\r\n\t\t) AS SOURCE\r\n\t\tON (TARGET.kKonfiggruppe = SOURCE.kKonfiggruppe \r\n\t\t\tAND TARGET.kShop = SOURCE.kShop)\r\n\t\tWHEN MATCHED THEN\r\n\t\t\tUPDATE SET cInet = 'Y'\r\n\t\tWHEN NOT MATCHED THEN\r\n\t\t\tINSERT (kkonfiggruppe, kShop, cInet)\r\n\t\t\tVALUES (SOURCE.kKonfiggruppe, SOURCE.kShop, 'Y');\r\n\r\n IF EXISTS\r\n (\r\n SELECT 1\r\n FROM #tgrtShopInsup\r\n WHERE #tgrtShopInsup.nTyp IN ( 0, 1, 4 )\r\n )\r\n AND NOT EXISTS\r\n (\r\n SELECT 1\r\n FROM Verkauf.tPlattformAuftragFeatures\r\n JOIN #tgrtShopInsup\r\n ON tPlattformAuftragFeatures.nTyp = #tgrtShopInsup.nTyp\r\n AND tPlattformAuftragFeatures.kShop = #tgrtShopInsup.kShop\r\n )\r\n BEGIN\r\n INSERT INTO Verkauf.tPlattformAuftragFeatures\r\n (\r\n nTyp,\r\n kShop,\r\n nBearbeiten,\r\n nBearbeitenMitWarnung,\r\n nLoeschen,\r\n nStornieren,\r\n nTeilrechnungErstellen,\r\n nRechnungErstellen,\r\n nZusammenfassen,\r\n nSplitten\r\n )\r\n SELECT 2 AS nTyp,\r\n #tgrtShopInsup.kShop AS kShop,\r\n 0 AS nBearbeiten,\r\n 0 AS nBearbeitenMitWarnung,\r\n 0 AS nLoeschen,\r\n 0 AS nStornieren,\r\n 0 AS nTeilrechnungErstellen,\r\n 0 AS nRechnungErstellen,\r\n 0 AS nZusammenfassen,\r\n 0 AS nSplitten\r\n FROM #tgrtShopInsup\r\n WHERE #tgrtShopInsup.nInserted = 1;\r\n END;\r\n\tEND\r\n\r\n\tIF (UPDATE(kWarenlager) OR UPDATE(kWarenlagerPlatz) OR UPDATE(nWarenlagerPlatztyp))\r\n\tBEGIN\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtShopInsup WHERE #tgrtShopInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\t--\r\n\t\t\t-- POS\r\n\t\t\t--\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN Sync.tEntityPlatform ON tEntityPlatform.kEntityId = tEntityTracking.kEntityId\r\n\t\t\t\tAND tEntityPlatform.nEntityType = tEntityTracking.nEntityType\r\n\t\t\tJOIN #tgrtShopInsup ON #tgrtShopInsup.kShop = tEntityPlatform.kShop\r\n\t\t\t\tAND #tgrtShopInsup.nPosBlock = 1\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 1\r\n\t\tEND\r\n\tEND\r\nEND TRY\r\nBEGIN CATCH\r\n\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuersatz",
|
|
"triggerName": "jtlActionValidator_tSteuersatz",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tSteuersatz]\r\n\tON [dbo].[tSteuersatz]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\r\n\t\tDELETE tSteuersatzschluessel\r\n\t\tFROM dbo.tSteuersatzschluessel\r\n\t\tJOIN DELETED ON DELETED.kSteuersatz = tSteuersatzschluessel.kSteuersatz;\r\n\t\t\t\r\n\tEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuersatz",
|
|
"triggerName": "tgr_tSteuersatz_Connector",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tSteuersatz_Connector]\r\nON [dbo].[tSteuersatz]\r\nAFTER UPDATE, INSERT, DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT OFF;\r\nBEGIN\t\r\n\r\n\tINSERT INTO dbo.tGlobalsQueue (kShop, nType, cName, kKey)\r\n\tSELECT dbo.tShop.kShop, 1, 'tSteuer', 1\r\n\tFROM dbo.tShop\t\r\n\tLEFT JOIN dbo.tGlobalsQueue ON dbo.tShop.kShop = dbo.tGlobalsQueue.kShop\r\n\t\tAND dbo.tGlobalsQueue.cName = 'tSteuer'\r\n\t\tAND dbo.tGlobalsQueue.kKey = 1\r\n\tWHERE\tdbo.tShop.nTyp = 0\r\n\t\t\tAND dbo.tGlobalsQueue.kKey IS NULL;\r\n\t\t\t\t\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tSteuerzone",
|
|
"triggerName": "jtlActionValidator_tSteuerzone",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tSteuerzone]\r\n\tON [dbo].[tSteuerzone]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\r\n\t\tDELETE tSteuerzoneLand\r\n\t\tFROM dbo.tSteuerzoneLand\r\n\t\tJOIN DELETED ON DELETED.kSteuerzone = tSteuerzoneLand.kSteuerzone;\r\n\r\n\t\tDELETE tSteuersatz\r\n\t\tFROM dbo.tSteuersatz\r\n\t\tJOIN DELETED ON DELETED.kSteuerzone = tSteuersatz.kSteuerzone;\r\n\t\t\t\r\n\tEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"triggerName": "tgr_tStueckliste_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tStueckliste_DEL]\r\nON [dbo].[tStueckliste]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF NOT EXISTS (SELECT 1 FROM DELETED) RETURN;\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\r\n\tDECLARE @Komplett AS INT = 1;\r\n\r\n\tIF (OBJECT_ID('tempdb..#tgrtStuecklisteDel') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtStuecklisteDel;\r\n\tEND\r\n\t\r\n\tCREATE TABLE #tgrtStuecklisteDel\r\n\t(\r\n\t\tkStueckliste INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tkVaterartikel INT NOT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtStuecklisteDel (kStueckliste, kArtikel, kVaterartikel)\r\n\t\tSELECT\r\n\t\t\tDELETED.kStueckliste,\r\n\t\t\tDELETED.kArtikel,\r\n\t\t\tDELETED.kVaterArtikel\r\n\t\tFROM DELETED;\r\n\r\n\t-- Stücklisten die keine Komponenten mehr haben auflösen\r\n\tUPDATE \r\n\t\tdbo.tArtikel\r\n\tSET\r\n\t\tkStueckliste = 0,\r\n\t\tcLagerAktiv = 'N'\r\n\tFROM dbo.tArtikel\r\n\tJOIN #tgrtStuecklisteDel ON tArtikel.kStueckliste = #tgrtStuecklisteDel.kStueckliste\r\n\tWHERE NOT EXISTS(SELECT tStueckliste.kStueckliste FROM dbo.tStueckliste WHERE tStueckliste.kStueckliste = #tgrtStuecklisteDel.kStueckliste)\r\n\r\n\t-- Stücklisten aktualisieren\r\n\tDECLARE @AktualisiereStueckliste AS Artikel.TYPE_spAktualisiereStueckliste;\r\n\t\r\n\tINSERT INTO @AktualisiereStueckliste (kArtikel_Stueckliste, nEnforceUpdateLagerbestand)\r\n\tSELECT #tgrtStuecklisteDel.kVaterartikel, CASE WHEN (ISNULL(tArtikel.cLagerAktiv, 'Y') = 'Y') THEN 1 ELSE 0 END\r\n\tFROM #tgrtStuecklisteDel\r\n\tLEFT JOIN dbo.tArtikel ON tArtikel.kArtikel = #tgrtStuecklisteDel.kArtikel\r\n\r\n\tIF (@@ROWCOUNT > 0)\r\n\tBEGIN\r\n\t\tEXEC Artikel.spAktualisiereStueckliste @AktualisiereStueckliste;\r\n\t\t\r\n\t\t--\r\n\t\t-- Stückliste im Shop aktualisieren\r\n\t\t--\r\n\t\tUPDATE dbo.tArtikelShop\r\n\t\t\tSET dbo.tArtikelShop.nAktion = dbo.tArtikelShop.nAktion | @Komplett,\r\n\t\t\t\tdbo.tArtikelShop.cInet = 'Y',\r\n\t\t\t\tdbo.tArtikelShop.nInBearbeitung = 0\r\n\t\tFROM dbo.tArtikelShop\r\n\t\tJOIN @AktualisiereStueckliste AS Artikel ON Artikel.kArtikel_Stueckliste = dbo.tArtikelShop.kArtikel;\r\n\tEND\r\n\r\n\t--\r\n\t-- POS\r\n\t--\r\n\t--\r\n\t-- Stuecklisten aus Trackingtabellen löschen\r\n\t--\r\n\tDELETE Sync.tEntityPlatform\r\n\tFROM Sync.tEntityPlatform\r\n\tJOIN #tgrtStuecklisteDel ON #tgrtStuecklisteDel.kStueckliste = tEntityPlatform.kEntityId\r\n\tWHERE tEntityPlatform.nEntityType = 7\r\n\r\n\tDELETE Sync.tEntityTracking\r\n\tFROM Sync.tEntityTracking\r\n\tJOIN #tgrtStuecklisteDel ON #tgrtStuecklisteDel.kStueckliste = tEntityTracking.kEntityId\r\n\tWHERE tEntityTracking.nEntityType = 7;\r\n\t\r\nEND TRY\r\nBEGIN CATCH\r\n\tBEGIN TRY\r\n\t\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\t\tEXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tEND TRY\r\n\tBEGIN CATCH\r\n\t\tIF ERROR_NUMBER() <> 266 THROW;\r\n\tEND CATCH;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tStueckliste",
|
|
"triggerName": "tgr_tStueckliste_INSUP",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tStueckliste_INSUP]\r\nON [dbo].[tStueckliste]\r\nAFTER INSERT, UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n IF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n IF NOT EXISTS(SELECT 1 FROM INSERTED) RETURN; -- INSERT, UPDATE, INSUP - Trigger\r\n \r\n DECLARE @Komplett AS INT = 1;\r\n\r\n\t-- Prüfung ob es überhaupt Änderungen gibt und der Trigger ausgeführt werden muss\r\n\tIF NOT EXISTS(SELECT 1 FROM INSERTED) RETURN;\r\n\r\n\t-- POS Abgleich Logik Start\r\n\tIF (OBJECT_ID('tempdb..#tgrtStuecklisteInsup') IS NOT NULL)\r\n\tBEGIN\r\n\t\tDROP TABLE #tgrtStuecklisteInsup;\r\n\tEND\r\n\r\n\tCREATE TABLE #tgrtStuecklisteInsup\r\n\t(\r\n\t\tkStueckliste INT NOT NULL,\r\n\t\tkArtikel INT NOT NULL,\r\n\t\tnPosBlock BIT NOT NULL,\r\n\t\tkVaterArtikel INT NULL\r\n\t);\r\n\r\n\tINSERT INTO #tgrtStuecklisteInsup (kStueckliste, kArtikel, nPosBlock, kVaterArtikel)\r\n\t\tSELECT\r\n\t\t\tInserted.kStueckliste,\r\n\t\t\tInserted.kArtikel,\r\n\t\t\tCASE WHEN EXISTS (SELECT Inserted.kArtikel, Inserted.fAnzahl EXCEPT SELECT Deleted.kArtikel, Deleted.fAnzahl)\r\n\t\t\tTHEN 1 ELSE 0 END AS nPosBlock,\r\n\t\t\tInserted.kVaterArtikel\r\n\t\tFROM Inserted\r\n\t\tFULL OUTER JOIN Deleted\tON Deleted.kStueckliste = Inserted.kStueckliste\r\n\t\t\tAND Deleted.kArtikel = Inserted.kArtikel;\r\n\r\n\t--\r\n\t-- Stücklistenväter der Stücklistenkomponenten ergänzen\r\n\t-- Nicht machen, wenn Daten per UPDATE geändert werden\r\n\t--\r\n\tIF NOT EXISTS(SELECT * FROM DELETED)\r\n\tBEGIN\r\n\t\tUPDATE dbo.tStueckliste\r\n\t\tSET tStueckliste.kVaterArtikel = tArtikel.kArtikel\r\n\t\tFROM #tgrtStuecklisteInsup\r\n\t\tJOIN dbo.tArtikel ON tArtikel.kStueckliste = #tgrtStuecklisteInsup.kStueckliste\r\n\t\tWHERE #tgrtStuecklisteInsup.kVaterArtikel <= 0 AND #tgrtStuecklisteInsup.kStueckliste = tStueckliste.kStueckliste\r\n\tEND\r\n\r\n\tIF (UPDATE(kArtikel) OR UPDATE(fAnzahl))\r\n\tBEGIN\r\n\t\t--\r\n\t\t-- POS Abgleich Logik\r\n\t\t--\r\n\t\tIF EXISTS (SELECT 1 FROM #tgrtStuecklisteInsup WHERE #tgrtStuecklisteInsup.nPosBlock = 1)\r\n\t\tBEGIN\r\n\t\t\tUPDATE Sync.tEntityTracking\r\n\t\t\tSET tEntityTracking.dLastModified = GETDATE()\r\n\t\t\tFROM Sync.tEntityTracking\r\n\t\t\tJOIN #tgrtStuecklisteInsup ON #tgrtStuecklisteInsup.kStueckliste = tEntityTracking.kEntityId\r\n\t\t\t\tAND #tgrtStuecklisteInsup.nPosBlock = 1\r\n\t\t\tWHERE tEntityTracking.nSyncType = 4\r\n\t\t\t\tAND tEntityTracking.nEntityType = 7;\r\n\t\tEND\r\n\r\n\t\t-- SP Aktualisiere Stückliste\r\n\t\tDECLARE @AktualisiereStueckliste AS Artikel.TYPE_spAktualisiereStueckliste;\r\n\t\t\r\n\t\tINSERT INTO @AktualisiereStueckliste (kArtikel_Stueckliste, nEnforceUpdateLagerbestand)\r\n\t\tSELECT #tgrtStuecklisteInsup.kVaterArtikel, 1 -- nPosBlock ist 1, wenn fAnzahl verändert wurde. In diesen Fällen muss der Bestand neu berechnet werden, daher nEnforceUpdateLagerbestand = 1\r\n\t\tFROM #tgrtStuecklisteInsup WHERE #tgrtStuecklisteInsup.nPosBlock = 1\r\n\r\n\t\tIF (@@ROWCOUNT > 0)\r\n\t\tBEGIN\r\n\t\t\tEXEC Artikel.spAktualisiereStueckliste @AktualisiereStueckliste;\r\n\t\t\r\n\t\t\t--\r\n\t\t\t-- Stückliste im Shop aktualisieren\r\n\t\t\t--\r\n\t\t\tUPDATE dbo.tArtikelShop\r\n\t\t\t\tSET dbo.tArtikelShop.nAktion = dbo.tArtikelShop.nAktion | @Komplett,\r\n\t\t\t\t\tdbo.tArtikelShop.cInet = 'Y',\r\n\t\t\t\t\tdbo.tArtikelShop.nInBearbeitung = 0\r\n\t\t\tFROM dbo.tArtikelShop\r\n\t\t\tJOIN @AktualisiereStueckliste AS Artikel ON Artikel.kArtikel_Stueckliste = dbo.tArtikelShop.kArtikel;\r\n\t\tEND\r\n\tEND\r\n \r\nEND TRY\r\nBEGIN CATCH\r\n\tBEGIN TRY\r\n\t\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\t\tEXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tEND TRY\r\n\tBEGIN CATCH\r\n\t\tIF ERROR_NUMBER() <> 266 THROW;\r\n\tEND CATCH;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"triggerName": "jtlActionValidator_tVersand",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tVersand]\r\n\tON [dbo].[tVersand]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\r\n\t\t--\r\n\t\t-- Paketinhalte entfernen\r\n\t\t--\r\n\t\t\tDELETE tVersandPos WITH(ROWLOCK)\r\n\t\t\tFROM tVersandPos WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tVersandPos.kVersand = DELETED.kVersand\r\n\t\t\t\r\n\t\t-- Gespeicherte Paketlabel entfernen\r\n\t\t\tDELETE [Shipping].[tShippingDocument] WITH(ROWLOCK)\r\n\t\t\tFROM [Shipping].[tShippingDocument] WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON [Shipping].[tShippingDocument].kVersand = DELETED.kVersand\t\t\r\n\tEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tVersand",
|
|
"triggerName": "tgr_dbo_tVersand_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_dbo_tVersand_INSUPDEL]\r\nON [dbo].[tVersand]\r\nAFTER INSERT, UPDATE, DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF NOT EXISTS(SELECT * FROM INSERTED) AND NOT EXISTS(SELECT * FROM DELETED) RETURN;\r\n\r\n\tIF OBJECT_ID('tempdb..#VersandChanged') IS NOT NULL DROP TABLE #VersandChanged;\r\n\tCREATE TABLE #VersandChanged (kLieferschein INT PRIMARY KEY NOT NULL);\r\n\t\r\n\tINSERT INTO #VersandChanged (kLieferschein)\r\n\tSELECT DISTINCT Sub.kLieferschein\r\n\tFROM\r\n\t(\r\n\t\tSELECT INSERTED.kLieferschein FROM INSERTED\r\n\t\tUNION\r\n\t\tSELECT DELETED.kLieferschein FROM DELETED\r\n\t) AS Sub\r\n\tWHERE Sub.kLieferschein > 0\r\n\t\t\r\n\tIF @@ROWCOUNT = 0 RETURN;\r\n\r\n\t--\r\n\t-- Lieferschein Eckdaten aktualisieren\r\n\t--\r\n\tUPDATE dbo.tLieferscheinEckdaten\r\n\tSET dVersendet = Pakete.dVersendet,\r\n\t\tnAnzahlPakete = ISNULL(Pakete.nAnzahlPakete, 0),\r\n\t\tnAnzahlVersendetePakete = ISNULL(Pakete.nAnzahlVersendetePakete, 0),\r\n\t\tnVersandStatus = Pakete.nStatus,\r\n\t\tkVersandArt = Pakete.kVersandart\r\n\tFROM dbo.tLieferscheinEckdaten\r\n\tJOIN #VersandChanged ON #VersandChanged.kLieferschein = tLieferscheinEckdaten.kLieferschein\r\n\tLEFT JOIN\r\n\t(\r\n\t\tSELECT\r\n\t\t\ttVersand.kLieferschein,\r\n\t\t\tMAX(tVersand.dVersendet) AS dVersendet,\r\n\t\t\tCOUNT(tVersand.kLieferschein) AS nAnzahlPakete,\r\n\t\t\tCOUNT(tVersand.dVersendet) AS nAnzahlVersendetePakete,\r\n\t\t\tMAX(tVersand.nStatus) AS nStatus,\r\n\t\t\tMAX(tVersand.kVersandArt) AS kVersandart\r\n\t\tFROM dbo.tVersand\r\n\t\tGROUP BY tVersand.kLieferschein\r\n\t) AS Pakete ON Pakete.kLieferschein = #VersandChanged.kLieferschein\r\n\t\r\n\r\nEND TRY\r\nBEGIN CATCH\r\n\tBEGIN TRY\r\n\t\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\t\tEXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tEND TRY\r\n\tBEGIN CATCH\r\n\t\tIF ERROR_NUMBER() <> 266 THROW;\r\n\tEND CATCH;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tversandart",
|
|
"triggerName": "jtlActionValidator_tVersandArt",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tVersandArt]\r\n\tON [dbo].[tversandart]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\r\n\t\t--\r\n\t\t-- tVersandschnittstellenKonfiguration entfernen\r\n\t\t--\r\n\t\t\tDELETE dbo.tVersandschnittstellenKonfiguration WITH(ROWLOCK)\r\n\t\t\tFROM dbo.tVersandschnittstellenKonfiguration WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON dbo.tVersandschnittstellenKonfiguration.kVersandArt = DELETED.kVersandArt\r\n\t\t\t\r\n\t\t\tDELETE dbo.tAmazonShippingDruckereinstellungen WITH(ROWLOCK)\r\n\t\t\tFROM dbo.tAmazonShippingDruckereinstellungen WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON dbo.tAmazonShippingDruckereinstellungen.kVersandArt = DELETED.kVersandArt\r\n\t\t\t\r\n\t\r\n\tEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLager",
|
|
"triggerName": "jtlActionValidator_tWarenLager",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tWarenLager]\r\n\tON [dbo].[tWarenLager]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\t IF EXISTS(SELECT 1 FROM DELETED)\r\n\t BEGIN\r\n\t\t--\r\n\t\t-- WarenlagerArtikelOptionen entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenlagerArtikelOptionen WITH(ROWLOCK)\r\n\t\t\tFROM tWarenlagerArtikelOptionen WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenlagerArtikelOptionen.kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tWarenLagerEingangHistorie entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenLagerEingangHistorie WITH(ROWLOCK)\r\n\t\t\tFROM tWarenLagerEingangHistorie WITH(ROWLOCK)\r\n\t\t\tJOIN tWarenlagerPlatz WITH(NOLOCK) ON (tWarenlagerPlatz.kWarenLagerPlatz = tWarenLagerEingangHistorie.kWarenLagerPlatzStart\tOR tWarenlagerPlatz.kWarenLagerPlatz = tWarenLagerEingangHistorie.kWarenLagerPlatzZiel)\t\t\t\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatz.kWarenLager = DELETED.kWarenLager\r\n\t\r\n\t\t--\r\n\t\t-- tWarenLagerFulFillmentDienstleister entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenLagerFulFillmentDienstleister WITH(ROWLOCK)\r\n\t\t\tFROM tWarenLagerFulFillmentDienstleister WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenLagerFulFillmentDienstleister .kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tWarenLagerOptionen entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenLagerOptionen WITH(ROWLOCK)\r\n\t\t\tFROM tWarenLagerOptionen WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenLagerOptionen .kWarenLager = DELETED.kWarenLager\r\n\r\n\t\t--\r\n\t\t-- tWmsInventurlog entfernen\r\n\t\t--\t\t\t\r\n\t\t\tDELETE tWmsInventurlog WITH(ROWLOCK)\r\n\t\t\tFROM tWmsInventurlog WITH(ROWLOCK)\r\n\t\t\tJOIN tWarenlagerPlatz WITH(NOLOCK) ON tWarenlagerPlatz.kWarenLagerPlatz = tWmsInventurlog.kWarenLagerPlatz\t\t\t\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatz.kWarenLager = DELETED.kWarenLager\r\n\r\n\r\n\t\t--\r\n\t\t-- tWarenLagerPlatz entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenLagerPlatz WITH(ROWLOCK)\r\n\t\t\tFROM tWarenLagerPlatz WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenLagerPlatz .kWarenLager = DELETED.kWarenLager\r\n\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tWarenLagerPrioGlobal entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenLagerPrioGlobal WITH(ROWLOCK)\r\n\t\t\tFROM tWarenLagerPrioGlobal WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenLagerPrioGlobal .kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tPickliste entfernen\r\n\t\t--\r\n\t\t\tDELETE tPickliste WITH(ROWLOCK)\r\n\t\t\tFROM tPickliste WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tPickliste .kWarenLager = DELETED.kWarenLager\r\n\r\n\t\t--\r\n\t\t-- tFulfillmentAuftrag entfernen\r\n\t\t--\r\n\t\t\tDELETE tFulfillmentAuftrag WITH(ROWLOCK)\r\n\t\t\tFROM tFulfillmentAuftrag WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tFulfillmentAuftrag.kWarenLager = DELETED.kWarenLager\r\n\t\t\t\t\t\t\r\n\t\t--\r\n\t\t-- tDruckQueue entfernen\r\n\t\t--\r\n\t\t\t\r\n\t\t\tDELETE tDruckQueue WITH(ROWLOCK)\r\n\t\t\tFROM tDruckQueue WITH(ROWLOCK)\r\n\t\t\tJOIN tWarenlagerPlatz WITH(NOLOCK) ON tWarenlagerPlatz.kWarenLagerPlatz = tDruckQueue.kWarenLagerPlatz\t\t\t\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatz.kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tWMSInventur entfernen\r\n\t\t--\r\n\t\t\tDELETE tWMSInventur WITH(ROWLOCK)\r\n\t\t\tFROM tWMSInventur WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWMSInventur .kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tlagerartikel entfernen\r\n\t\t--\r\n\t\t-- Fuer Seriennummern 2.0 sollte das nicht relevant sein, da wir die Seriennummern an Warenlagereingänge koppelt.\r\n\t\t-- Entfernen wenn Seriennummern 2.0 standard wird\r\n\t\t\tDELETE tlagerartikel WITH(ROWLOCK)\r\n\t\t\tFROM tlagerartikel WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tlagerartikel.kWarenLager = DELETED.kWarenLager\r\n\t\t\t\r\n\t\t--\r\n\t\t-- tFormularVorlagen aktualisieren\r\n\t\t--\r\n\t\t\tUPDATE tFormularVorlage WITH(ROWLOCK)\r\n\t\t\t\tSET tFormularVorlage.kWarenLager = 0\r\n\t\t\tFROM tFormularVorlage WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tFormularVorlage.kWarenLager = DELETED.kWarenLager\r\n\r\n\t --\r\n\t\t-- tArtikelHistory entfernen\r\n\t\t--\r\n\t\t\tDELETE tArtikelHistory WITH(ROWLOCK)\r\n\t\t\tFROM tArtikelHistory WITH(ROWLOCK)\r\n\t\t\tJOIN tWarenlagerPlatz WITH(NOLOCK) ON tWarenlagerPlatz.kWarenLagerPlatz = tArtikelHistory.kWarenLagerPlatz\t\t\t\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatz.kWarenLager = DELETED.kWarenLager\r\n\r\n --\r\n\t\t-- tInventur entfernen\r\n\t\t--\r\n\t\t\tDELETE tInventur WITH(ROWLOCK)\r\n\t\t\tFROM tInventur WITH(ROWLOCK)\r\n\t\t\tJOIN tWarenlagerPlatz WITH(NOLOCK) ON tWarenlagerPlatz.kWarenLagerPlatz = tInventur.kWarenLagerPlatz\t\t\t\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatz.kWarenLager = DELETED.kWarenLager\r\n\r\n\t\t--\r\n\t\t-- tLHM entfernen\r\n\t\t--\r\n\t\t\tDELETE tLHM WITH(ROWLOCK)\r\n\t\t\tFROM tLHM WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tLHM .kWarenLager = DELETED.kWarenLager\r\n\tEND\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLager",
|
|
"triggerName": "tgr_tWarenLager_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tWarenLager_INSUPDEL]\r\n\tON [dbo].[tWarenLager]\r\n\tAFTER INSERT, UPDATE, DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\t\t-- Aenderungen in Versand.tVersandlager schreiben\r\n\t\t\r\n\t\tMERGE INTO Versand.tVersandlager \r\n\t\tUSING VersandIntern.vVersandlager ON vVersandlager.kWarenlager = tVersandlager.kWarenlager\r\n\t\tWHEN MATCHED THEN\r\n\t\t\tUPDATE SET tVersandlager.nTyp = vVersandlager.nTyp\r\n\t\tWHEN NOT MATCHED BY TARGET THEN\r\n\t\t\tINSERT (kWarenlager, nTyp) VALUES (vVersandlager.kWarenlager, vVersandlager.nTyp)\r\n\t\tWHEN NOT MATCHED BY SOURCE THEN\r\n\t\t\tDELETE;\r\n\tEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"triggerName": "jtlActionValidator_tWarenLagerPlatz",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tWarenLagerPlatz]\r\n\tON [dbo].[tWarenLagerPlatz]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tDECLARE @kWarenlagerPlatz INT\r\n\tDECLARE @kWarenlager INT\r\n\r\n\tBEGIN\r\n\t IF EXISTS(SELECT 1 FROM DELETED)\r\n\t BEGIN\r\n\t\t--\r\n\t\t-- WarenlagerArtikelPlatz entfernen\r\n\t\t--\r\n\t\t\tDELETE tWarenlagerPlatzArtikel WITH(ROWLOCK)\r\n\t\t\tFROM tWarenlagerPlatzArtikel WITH(ROWLOCK)\r\n\t\t\tJOIN DELETED ON tWarenlagerPlatzArtikel.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\r\n\t\t\tWHERE tWarenlagerPlatzArtikel.cKommentar_1 IS NULL AND tWarenlagerPlatzArtikel.cKommentar_1 IS NULL\r\n\t\t\t\t\t\t\r\n\t\t--\r\n\t\t-- LHMs auf den Platz löschen\r\n\t\t--\t\r\n\t\t DELETE tLHM WITH(ROWLOCK)\r\n\t\t FROM tLHM WITH(ROWLOCK)\r\n\t\t JOIN DELETED ON tLHM.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\r\n\t\t \r\n\t\t\t\r\n\t\t--\r\n\t\t-- Plätze in Lagerbereichen Löschen\r\n\t\t--\r\n\t\t DELETE tWMSLagerBereichPlatz \r\n\t\t FROM tWMSLagerBereichPlatz\t\r\n\t\t JOIN DELETED ON tWMSLagerBereichPlatz.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\r\n\t\t\t\t\t\t\r\n\t\t--\r\n\t\t-- Artikelhistory des Platzes löschen\r\n\t\t--\r\n\t\t DELETE tArtikelHistory \r\n\t\t FROM tArtikelHistory\t\r\n\t\t JOIN DELETED ON tArtikelHistory.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\t\t\r\n\r\n\r\n\t\t--\r\n\t\t-- Vorgabeplätze löschen\r\n\t\t--\r\n\t\t DELETE tWarenlagerartikeloptionen\r\n\t\t FROM tWarenlagerartikeloptionen\r\n\t\t JOIN DELETED ON tWarenlagerartikeloptionen.kWarenLagerPlatz = DELETED.kWarenLagerPlatz;\r\n\r\n\t\t\r\n\t\t--\r\n\t\t-- Umbuchen von allen Warenlagereingängen,Ausgängen,ArtikelHistory von dem Platz auf einen anderen Platz names \"SYSTEM-JTL\"\r\n\t\t--\r\n\t\t DECLARE @OldContextInfo VARBINARY(128)\r\n\r\n\t\t IF(CONTEXT_INFO() IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t SET @OldContextInfo = CONTEXT_INFO()\r\n\t\t\tEND;\r\n\t\t\tELSE\r\n\t\t\tBEGIN\r\n\t\t\t SET @OldContextInfo = 0x0000\r\n\t\t END;\r\n\r\n\r\n\t\t SET CONTEXT_INFO 0x5097;\r\n\r\n\t\t UPDATE dbo.tWarenLagerEingang\r\n\t\t SET kWarenLagerPlatz = tWarenlagerPlatz.kWarenlagerPlatz\r\n\t\t FROM tWarenLagerEingang\r\n\t\t JOIN DELETED ON tWarenLagerEingang.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\r\n\t\t JOIN tWarenlagerPlatz ON tWarenlagerPlatz.kWarenlager = DELETED.kWarenlager AND tWarenlagerPlatz.cName = 'SYSTEM-JTL' \r\n\r\n\t\t SET CONTEXT_INFO @OldContextInfo\r\n\r\n\t\t UPDATE FulfillmentNetwork.tStockRef\r\n\t\t SET kWarenLagerPlatz = tWarenlagerPlatz.kWarenlagerPlatz\r\n\t\t FROM FulfillmentNetwork.tStockRef\r\n\t\t JOIN DELETED ON FulfillmentNetwork.tStockRef.kWarenLagerPlatz = DELETED.kWarenLagerPlatz\r\n\t\t JOIN tWarenlagerPlatz ON tWarenlagerPlatz.kWarenlager = DELETED.kWarenlager AND tWarenlagerPlatz.cName = 'SYSTEM-JTL'\r\n\t\t\t\t\r\n\t\t\t\t\r\n\tEND\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tWarenLagerPlatz",
|
|
"triggerName": "tgr_tWarenLagerPlatz_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tWarenLagerPlatz_INSUPDEL]\r\nON [dbo].[tWarenLagerPlatz]\r\nAFTER INSERT, UPDATE, DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n IF NOT EXISTS(SELECT * FROM INSERTED) AND NOT EXISTS(SELECT * FROM DELETED) RETURN;\r\n\r\n\tIF (UPDATE(nStatus) OR UPDATE(nAuslieferungGesperrt) OR UPDATE(nGesperrt))\r\n\tBEGIN\r\n\t\tIF (UPDATE(nStatus))\r\n\t\tBEGIN\r\n\t\t\tIF (OBJECT_ID('tempdb..#BetroffenePlaetze') IS NOT NULL)\r\n\t\t\tBEGIN\r\n\t\t\t\tDROP TABLE #BetroffenePlaetze;\r\n\t\t\tEND\r\n\r\n\t\t\tCREATE TABLE #BetroffenePlaetze (kWarenLagerPlatz INT PRIMARY KEY NOT NULL, nAuslieferungGesperrt BIT NOT NULL);\r\n\t\t\tINSERT INTO #BetroffenePlaetze (kWarenLagerPlatz, nAuslieferungGesperrt)\r\n\t\t\tSELECT\r\n\t\t\t\tINSERTED.kWarenLagerPlatz,\r\n\t\t\t\tCASE WHEN INSERTED.nStatus = 0 THEN 0 ELSE 1 END\r\n\t\t\tFROM\r\n\t\t\t\tINSERTED\r\n\t\t\tLEFT JOIN DELETED ON DELETED.kWarenLagerPlatz = INSERTED.kWarenLagerPlatz\r\n\t\t\tJOIN dbo.tWarenLager ON tWarenLager.kWarenLager = INSERTED.kWarenLager\r\n\t\t\tWHERE tWarenLager.nAktiv = 1 AND (INSERTED.nStatus <> DELETED.nStatus OR DELETED.nStatus IS NULL)\r\n\t\t\tAND (CASE WHEN INSERTED.nStatus = 0 THEN 0 ELSE 1 END <> INSERTED.nAuslieferungGesperrt);\r\n\r\n\t\t\tIF (@@ROWCOUNT > 0)\r\n\t\t\tBEGIN\r\n\t\t\t\tUPDATE\r\n\t\t\t\t\tdbo.tWarenLagerPlatz\r\n\t\t\t\tSET nAuslieferungGesperrt = #BetroffenePlaetze.nAuslieferungGesperrt\r\n\t\t\t\tFROM dbo.tWarenLagerPlatz\r\n\t\t\t\tJOIN #BetroffenePlaetze ON #BetroffenePlaetze.kWarenLagerPlatz = tWarenLagerPlatz.kWarenLagerPlatz;\r\n\t\t\tEND\r\n\t\tEND\r\n\r\n\t\tDECLARE @typeLagerbestandProLager AS TYPE_spUpdateLagerbestandProLager;\r\n\t\tINSERT INTO @typeLagerbestandProLager (kArtikel,kWarenlager)\r\n\t\tSELECT DISTINCT\r\n\t\t\ttWarenLagerEingang.kArtikel,\r\n\t\t\ttWarenLager.kWarenLager\r\n\t\tFROM\r\n\t\t\tINSERTED\r\n\t\tJOIN DELETED ON DELETED.kWarenLagerPlatz = INSERTED.kWarenLagerPlatz\r\n\t\tJOIN dbo.tWarenLager ON tWarenLager.kWarenLager = INSERTED.kWarenLager\r\n\t\tJOIN dbo.tWarenLagerEingang ON tWarenLagerEingang.kWarenLagerPlatz = INSERTED.kWarenLagerPlatz AND tWarenLagerEingang.fAnzahlAktuell > 0.0\r\n\t\tWHERE tWarenLager.nAktiv = 1\r\n\t\t\tAND EXISTS(\r\n\t\t\t\tSELECT INSERTED.nStatus, INSERTED.nGesperrt, INSERTED.nAuslieferungGesperrt\r\n\t\t\t\tEXCEPT SELECT DELETED.nStatus, DELETED.nGesperrt, DELETED.nAuslieferungGesperrt\r\n\t\t\t);\r\n\r\n\t\tIF (@@ROWCOUNT > 0)\r\n\t\tBEGIN\r\n\t\t\tEXEC dbo.spUpdateLagerbestandProLager @typeLagerbestandProLager;\r\n\r\n\t\t\tDECLARE @lagerbestand TYPE_spUpdateLagerbestand;\r\n\r\n INSERT INTO @lagerbestand ( kArtikel )\r\n\t\t SELECT DISTINCT kArtikel\r\n\t\t\tFROM @typeLagerbestandProLager\r\n\r\n EXEC dbo.spUpdateLagerbestand @Artikel = @lagerbestand;\r\n\t\tEND\r\n\tEND\r\n\r\nEND TRY\r\nBEGIN CATCH\r\n DECLARE @DeadlockRetries TINYINT;\r\n\tEXEC dbo.spErrorHandler\r\n\t @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"triggerName": "tgr_dbo_tZahlung_DEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_dbo_tZahlung_DEL]\r\nON [dbo].[tZahlung]\r\nAFTER DELETE\r\nAS\r\nSET ANSI_NULLS ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET ANSI_WARNINGS ON;\r\nSET ANSI_PADDING ON;\r\nSET NOCOUNT ON;\r\nBEGIN\r\n \r\n IF NOT EXISTS(SELECT 1 FROM DELETED) RETURN;\r\n \r\n DELETE FROM Verkauf.tAuftragkosten\r\n FROM tZahlungsabgleichUmsatz AS tZahlungsabgleichUmsatzReferenz \r\n INNER JOIN Verkauf.tAuftragkosten \r\n ON tZahlungsabgleichUmsatzReferenz.kZahlungsabgleichUmsatz = Verkauf.tAuftragkosten.kZahlungsabgleichUmsatz \r\n INNER JOIN tZahlungsabgleichUmsatz\r\n INNER JOIN (SELECT DISTINCT DELETED.kZahlungsabgleichUmsatz FROM DELETED) AS DeletedZahlung \r\n ON tZahlungsabgleichUmsatz.kZahlungsabgleichUmsatz = DeletedZahlung.kZahlungsabgleichUmsatz \r\n ON tZahlungsabgleichUmsatzReferenz.cReferenzTransaktionID = tZahlungsabgleichUmsatz.cTransaktionID And tZahlungsabgleichUmsatzReferenz.kZahlungsabgleichModul = tZahlungsabgleichUmsatz.kZahlungsabgleichModul\r\n \r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlung",
|
|
"triggerName": "tgr_tZahlung_INSUPDEL",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[tgr_tZahlung_INSUPDEL]\r\nON [dbo].[tZahlung]\r\nAFTER INSERT, UPDATE, DELETE\r\nAS\r\nSET ANSI_NULLS ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET ANSI_WARNINGS ON;\r\nSET ANSI_PADDING ON;\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\t--Überprüfen ob Trigger gefüllt aufgerufen wird\r\n\tIF NOT EXISTS(SELECT * FROM INSERTED FULL JOIN DELETED ON INSERTED.kZahlung = DELETED.kZahlung)\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND\r\n\r\n\tINSERT INTO dbo.tLog (dDatum, kBenutzer, cLog, nTyp, nVorgang)\r\n\tSELECT GETDATE(), INSERTED.kBenutzer, 'Zahlung gesetzt: Bestellung ' + CONVERT(NVARCHAR(4000), vAuftrag.cAuftragsNr) + ' ('+ CONVERT(NVARCHAR(4000), INSERTED.kBestellung) + ') Betrag: ' + CONVERT(NVARCHAR(4000), CAST(INSERTED.fBetrag AS DECIMAL(28, 2))), 8, 1\r\n\tFROM INSERTED\r\n\tLEFT JOIN DELETED ON INSERTED.kZahlung = DELETED.kZahlung\r\n\tJOIN Verkauf.vAuftrag ON INSERTED.kBestellung = vAuftrag.kAuftrag\r\n\tWHERE DELETED.kZahlung IS NULL;\r\n\r\n\tINSERT INTO dbo.tLog (dDatum, kBenutzer, cLog, nTyp, nVorgang)\r\n\tSELECT GETDATE(), INSERTED.kBenutzer, 'Zahlung geändert: Bestellung ' + CONVERT(NVARCHAR(4000), vAuftrag.cAuftragsNr) + ' ('+ CONVERT(NVARCHAR(4000), INSERTED.kBestellung) + ') Betrag: ' + CONVERT(NVARCHAR(4000), CAST(INSERTED.fBetrag AS DECIMAL(28, 2))), 8, 2\r\n\tFROM INSERTED\r\n\tJOIN DELETED ON INSERTED.kZahlung = DELETED.kZahlung\r\n\tJOIN Verkauf.vAuftrag ON INSERTED.kBestellung = vAuftrag.kAuftrag\r\n\tWHERE DELETED.fBetrag <> INSERTED.fBetrag;\r\n\r\n\tINSERT INTO dbo.tLog (dDatum, kBenutzer, cLog, nTyp, nVorgang)\r\n\tSELECT GETDATE(), DELETED.kBenutzer, 'Zahlung gelöscht: Bestellung ' + CONVERT(NVARCHAR(4000), vAuftrag.cAuftragsNr) + ' ('+ CONVERT(NVARCHAR(4000), DELETED.kBestellung) + ') Betrag: ' + CONVERT(NVARCHAR(4000), CAST(DELETED.fBetrag AS DECIMAL(28, 2))), 8, 3\r\n\tFROM DELETED\r\n\tLEFT JOIN INSERTED ON DELETED.kZahlung = INSERTED.kZahlung\r\n\tJOIN Verkauf.vAuftrag ON DELETED.kBestellung = vAuftrag.kAuftrag\r\n\tWHERE INSERTED.kZahlung IS NULL;\r\n\r\n\t--Eckdaten von der Rechnung berechnen\r\n\tDECLARE @Rechnungen AS Rechnung.TYPE_spRechnungEckdatenBerechnen\r\n\t\r\n\t--Zahlung von der Rechnung\r\n\tINSERT INTO @Rechnungen (kRechnung)\t\r\n\tSELECT DISTINCT tempKeys.kRechnung\r\n\tFROM (\r\n\t\t\tSELECT DELETED.kGutschrift, DELETED.kRechnung FROM DELETED\r\n\t\t\tUNION\r\n\t\t\tSELECT INSERTED.kGutschrift, INSERTED.kRechnung FROM INSERTED\r\n\t\t) tempKeys\r\n\tWHERE (tempKeys.kGutschrift IS NULL OR tempKeys.kGutschrift = 0) \r\n\t\tAND tempKeys.kRechnung > 0\r\n\r\n\t--Zahlungen von Gutschrift/Rechnungskorrektur\r\n\tINSERT INTO @Rechnungen (kRechnung)\t\r\n\tSELECT DISTINCT tgutschrift.kRechnung\r\n\tFROM (\r\n\t\t\tSELECT DELETED.kGutschrift FROM DELETED\r\n\t\t\tUNION\r\n\t\t\tSELECT INSERTED.kGutschrift FROM INSERTED\r\n\t\t) tempKeys\r\n\tJOIN dbo.tgutschrift ON tgutschrift.kGutschrift = tempKeys.kGutschrift\r\n\tWHERE tgutschrift.kRechnung > 0\r\n\t\r\n\tIF EXISTS(SELECT * FROM @Rechnungen)\r\n\tBEGIN\r\n\t\tEXEC Rechnung.spRechnungEckdatenBerechnen @Rechnungen\r\n\tEND\r\n\r\n\t--Eckdaten vom Auftrag berechnen\r\n\tDECLARE @Auftraege AS Verkauf.TYPE_spAuftragEckdatenBerechnen;\r\n\t\r\n\t--Zahlungen vom Auftrag\r\n\tINSERT INTO @Auftraege (kAuftrag)\t\r\n\tSELECT DISTINCT tempKeys.kBestellung\r\n\tFROM (\r\n\t\t\tSELECT DELETED.kGutschrift, DELETED.kRechnung, DELETED.kBestellung FROM DELETED\r\n\t\t\tUNION\r\n\t\t\tSELECT INSERTED.kGutschrift, INSERTED.kRechnung, INSERTED.kBestellung FROM INSERTED\r\n\t\t) tempKeys\r\n\tWHERE (tempKeys.kGutschrift IS NULL OR tempKeys.kGutschrift = 0) \r\n\t\tAND (tempKeys.kRechnung IS NULL OR tempKeys.kRechnung = 0) \r\n\t\tAND tempKeys.kBestellung > 0\r\n\t\r\n\tIF EXISTS(SELECT * FROM @Auftraege)\r\n\tBEGIN\r\n\t\tEXEC Verkauf.spAuftragEckdatenBerechnen @Auftrag = @Auftraege;\r\n\tEND\r\n\r\n\tDECLARE @kZahlungenOhneZahlungsart AS TABLE (kZahlung INT)\r\n\t\r\n\t--\r\n\t-- Hier wird sichergestellt, dass kZahlungsart nicht 0 ist\r\n\t-- Dies ist für Ameisenexporte von Rechnungen erforderlich\r\n\t-- Der Wert 0 als Zahlungsart kann durch Importe aus externen Systemen entstehen\r\n\t--\r\n\tINSERT INTO @kZahlungenOhneZahlungsart (kZahlung)\r\n\tSELECT U1.kZahlung FROM\r\n\t(\r\n\t\tSELECT DELETED.kZahlung, DELETED.kZahlungsart FROM DELETED WHERE ISNULL(DELETED.kZahlungsart, 0) = 0\t\r\n\t\tUNION\r\n\t\tSELECT INSERTED.kZahlung, INSERTED.kZahlungsart FROM INSERTED WHERE ISNULL(INSERTED.kZahlungsart, 0) = 0\r\n\t) AS U1\r\n\r\n\tIF EXISTS(SELECT * FROM @kZahlungenOhneZahlungsart)\r\n\tBEGIN\r\n\t\tDECLARE @kStandardZahlungsart INT\r\n\t\tSET @kStandardZahlungsart = ISNULL((SELECT TOP 1 tZahlungsart.kZahlungsart FROM tZahlungsart), 0)\r\n\r\n\t\t--\r\n\t\t-- Wenn keine Zahlungsart ermittelt werden kann wird eine Dummy-Zahlungsart angelegt\r\n\t\t--\r\n\t\tIF(@kStandardZahlungsart = 0)\r\n\t\tBEGIN\r\n\t\t\tDECLARE @kZahlungsartPK AS TABLE (kZahlungsart INT)\r\n\t\t\tINSERT INTO @kZahlungsartPK(kZahlungsart) EXEC spGetAndUpdatePK 'tZahlungsart'\r\n\t\t\tSET @kStandardZahlungsart = ISNULL((SELECT TOP 1 kZahlungsart FROM @kZahlungsartPK), 0)\t\r\n\t\t\t\t\t\r\n\t\t\tINSERT INTO tZahlungsart(kZahlungsart, cName, cPrtString, nLastschrift, cPrtStringVor, cPaymentOption, cKonto, nAusliefernVorZahlung)\r\n\t\t\tVALUES(@kStandardZahlungsart, 'Automatisch angelegt', '', 0, '', '', '', 0)\r\n\t\tEND\r\n\r\n\t\t--\r\n\t\t-- Zahlungsart setzen wo diese = 0 ist\r\n\t\t--\r\n\t\tUPDATE tZahlung WITH(ROWLOCK) SET tZahlung.kZahlungsart = ISNULL(tZahlungsart.kZahlungsart, @kStandardZahlungsart)\r\n\t\tFROM tZahlung WITH(ROWLOCK)\r\n\t\tLEFT JOIN tZahlungsart WITH(NOLOCK) ON LOWER(tZahlung.cName) = LOWER(tZahlungsart.cName)\r\n\t\tWHERE tZahlung.kZahlung IN\r\n\t\t(\r\n\t\t\tSELECT kZahlung FROM @kZahlungenOhneZahlungsart\r\n\t\t)\r\n\tEND\r\n\r\n\t--\r\n\t-- Manuelles Konto von Zahlungsart übernehmen, wenn bei Erstellung keines vorhanden ist.\r\n\t--\r\n\tIF NOT EXISTS(SELECT * FROM deleted) -- Wird nur bei Insert ausgeführt, sprich es wird kein alter Datensatz bei Update verworfen\r\n\tBEGIN\r\n\t\tUPDATE dbo.tZahlung\r\n\t\tSET\r\n\t\t\tcSKRmanuell = tZahlungsart.cKonto\r\n\t\tFROM dbo.tZahlung AS BestehendeZeilen\r\n\t\tJOIN inserted AS NeueZeilen ON\r\n\t\t\tBestehendeZeilen.kZahlung = NeueZeilen.kZahlung\r\n\t\tJOIN dbo.tZahlungsart ON\r\n\t\t\tBestehendeZeilen.kZahlungsart = tZahlungsart.kZahlungsart\r\n\t\tWHERE\r\n\t\t\tISNULL(NeueZeilen.cSKRmanuell, '') = ''\r\n\tEND\r\n\r\n\t--\r\n\t-- Kundenhistorie schreiben\r\n\t--\r\n\t\r\n\tINSERT INTO Kunde.tHistorie (kKunde,\r\n\t\t\t\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\t\t\t\tkVorgang,\r\n\t\t\t\t\t\t\t\tkKey,\r\n\t\t\t\t\t\t\t\tcValue1,\r\n\t\t\t\t\t\t\t\tcValue2,\r\n\t\t\t\t\t\t\t\tcValue3,\r\n\t\t\t\t\t\t\t\tfValue1,\r\n\t\t\t\t\t\t\t\tfValue2,\r\n\t\t\t\t\t\t\t\tdErstellt,\r\n\t\t\t\t\t\t\t\tkBenutzer)\r\n\tSELECT\tvAuftrag.kKunde,\r\n\t\t\tInserted.kBestellung,\r\n\t\t\tCASE WHEN (vAuftragEckdaten.fWertBrutto = vAuftragEckdaten.fZahlung) THEN 21 ELSE 20 END,\r\n\t\t\tInserted.kZahlung,\r\n\t\t\t'',\r\n\t\t\ttZahlungsart.cName,\r\n\t\t\tvAuftrag.cWaehrung,\r\n\t\t\ttZahlung.fBetrag,\r\n\t\t\tvAuftragEckdaten.fWertBrutto - vAuftragEckdaten.fZahlung,\r\n\t\t\tGETDATE(),\r\n\t\t\tInserted.kBenutzer\r\n\tFROM Inserted\r\n\tJOIN Verkauf.vAuftrag ON vAuftrag.kAuftrag = Inserted.kBestellung\r\n\tJOIN Verkauf.vAuftragEckdaten ON vAuftragEckdaten.kAuftrag = vAuftrag.kAuftrag\r\n\tJOIN dbo.tZahlung ON tZahlung.kZahlung = Inserted.kZahlung\r\n\tJOIN dbo.tZahlungsart ON tZahlungsart.kZahlungsart = tZahlung.kZahlungsart\r\n\tJOIN dbo.tKunde ON vAuftrag.kKunde = tKunde.kKunde\r\n\tWHERE Inserted.kZahlung NOT IN (SELECT Deleted.kZahlung FROM Deleted)\r\n\t\tAND Inserted.fBetrag > 0.0;\r\n\r\n\tINSERT INTO Kunde.tHistorie (kKunde,\r\n\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\tkVorgang,\r\n\t\t\t\t\tkKey,\r\n\t\t\t\t\tcValue1,\r\n\t\t\t\t\tcValue2,\r\n\t\t\t\t\tcValue3,\r\n\t\t\t\t\tfValue1,\r\n\t\t\t\t\tfValue2,\r\n\t\t\t\t\tdErstellt,\r\n\t\t\t\t\tkBenutzer)\r\n\tSELECT\tvAuftrag.kKunde,\r\n\t\tInserted.kBestellung,\r\n\t\t49,\r\n\t\tInserted.kZahlung,\r\n\t\t'',\r\n\t\ttZahlungsart.cName,\r\n\t\tvAuftrag.cWaehrung,\r\n\t\ttZahlung.fBetrag,\r\n\t\tvAuftragEckdaten.fWertBrutto - vAuftragEckdaten.fZahlung,\r\n\t\tGETDATE(),\r\n\t\tInserted.kBenutzer\r\n\tFROM INSERTED\r\n\tJOIN DELETED ON INSERTED.kZahlung = DELETED.kZahlung\r\n\tJOIN Verkauf.vAuftrag ON INSERTED.kBestellung = vAuftrag.kAuftrag\r\n\tJOIN Verkauf.vAuftragEckdaten ON vAuftragEckdaten.kAuftrag = vAuftrag.kAuftrag\r\n\tJOIN dbo.tZahlung ON tZahlung.kZahlung = Inserted.kZahlung\r\n\tJOIN dbo.tZahlungsart ON tZahlungsart.kZahlungsart = tZahlung.kZahlungsart\r\n\tJOIN dbo.tKunde ON vAuftrag.kKunde = tKunde.kKunde\r\n\tWHERE DELETED.fBetrag <> INSERTED.fBetrag;\r\n\t\r\n\t--\r\n\t-- Eingangsrechnungen aktualisieren\r\n\t--\r\n\tDECLARE @EingangsrechnungIDs dbo.TYPE_spEingangsrechnungStatusSetzen\r\n\tINSERT INTO @EingangsrechnungIDs(kEingangsrechnung) \r\n\tSELECT U1.kEingangsrechnung \r\n\tFROM \r\n\t( \r\n\t\tSELECT deleted.kEingangsrechnung FROM deleted WHERE deleted.kEingangsrechnung > 0 \r\n\t\tUNION \r\n\t\tSELECT inserted.kEingangsrechnung FROM inserted WHERE inserted.kEingangsrechnung > 0 \r\n\t) AS U1\t\t \r\n\t\r\n\tIF EXISTS(SELECT * FROM @EingangsrechnungIDs)\r\n\tBEGIN\r\n\t\tEXEC spEingangsrechnungStatusSetzen @EingangsrechnungIDs;\r\n\tEND\r\n\t\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsart",
|
|
"triggerName": "jtlActionValidator_tZahlungsart",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [dbo].[jtlActionValidator_tZahlungsart]\r\n\tON [dbo].[tZahlungsart]\r\n\tAFTER DELETE\r\n\tAS\r\n\tSET NOCOUNT ON;\r\n\tSET ANSI_NULLS ON;\r\n\tSET ANSI_NULL_DFLT_ON ON;\r\n\tSET ANSI_PADDING ON;\r\n\tSET CONCAT_NULL_YIELDS_NULL ON;\r\n\tSET XACT_ABORT OFF;\r\n\tBEGIN\r\n\r\n\r\n\t DELETE dbo.tZahlungsArtSprache\r\n\t FROM dbo.tZahlungsArtSprache\r\n\t JOIN DELETED ON DELETED.kZahlungsart = dbo.tZahlungsArtSprache.kZahlungsart;\t \r\n \r\n\t\r\n\tEND;\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "dbo",
|
|
"tableName": "tZahlungsart",
|
|
"triggerName": "tgr_dbo_tZahlungsart_UPDATE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER dbo.tgr_dbo_tZahlungsart_UPDATE\r\nON [dbo].[tZahlungsart]\r\nAFTER UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nSET ANSI_NULLS ON;\r\nSET ANSI_NULL_DFLT_ON ON;\r\nSET ANSI_PADDING ON;\r\nSET CONCAT_NULL_YIELDS_NULL ON;\r\nSET XACT_ABORT ON;\r\nBEGIN TRY\r\n\tIF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN;\r\n\tIF NOT EXISTS(SELECT * FROM INSERTED) AND NOT EXISTS(SELECT * FROM DELETED) RETURN;\r\n\tIF NOT UPDATE(nAusliefernVorZahlung) RETURN;\r\n\tIF OBJECT_ID('tempdb..#tgrZahlungsartChanged') IS NOT NULL DROP TABLE #tgrZahlungsartChanged;\r\n\tCREATE TABLE #tgrZahlungsartChanged (kZahlungsart INT PRIMARY KEY NOT NULL);\r\n\tINSERT INTO #tgrZahlungsartChanged (kZahlungsart)\r\n\t\tSELECT\r\n\t\t\tINSERTED.kZahlungsart\r\n\t\tFROM INSERTED\r\n\t\tLEFT JOIN DELETED ON DELETED.kZahlungsart = INSERTED.kZahlungsart\r\n\t\tWHERE EXISTS(SELECT INSERTED.nAusliefernVorZahlung EXCEPT SELECT DELETED.nAusliefernVorZahlung);\r\n\tIF @@ROWCOUNT = 0 RETURN;\r\n\r\n\t--\r\n\t-- Eckdaten für nicht komplett ausgelieferte Aufträge neu berechnen, die geänderte Zahlungsart besitzen\r\n\t--\r\n\tDECLARE @Auftrag AS Verkauf.TYPE_spAuftragEckdatenBerechnen;\r\n\r\n\tINSERT INTO @Auftrag (kAuftrag)\r\n\tSELECT DISTINCT tAuftrag.kAuftrag\r\n\tFROM #tgrZahlungsartChanged\r\n\tJOIN Verkauf.tAuftrag ON tAuftrag.kZahlungsart = #tgrZahlungsartChanged.kZahlungsart\r\n\tWHERE tAuftrag.nKomplettAusgeliefert = 0;\r\n\r\n\tEXEC Verkauf.spAuftragEckdatenBerechnen @Auftrag = @Auftrag;\r\n\r\nEND TRY\r\nBEGIN CATCH\r\n\tBEGIN TRY\r\n\t\tDECLARE @DeadlockRetries TINYINT = 0;\r\n\t\tEXEC dbo.spErrorHandler @DeadlockRetries = @DeadlockRetries OUTPUT;\r\n\tEND TRY\r\n\tBEGIN CATCH\r\n\t\tIF ERROR_NUMBER() <> 266 THROW;\r\n\tEND CATCH;\r\n\tTHROW;\r\nEND CATCH\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"triggerName": "tgr_Verkauf_tAuftrag_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftrag_DELETE]\r\nON [Verkauf].[tAuftrag]\r\nAFTER DELETE\r\nAS\r\nBEGIN\r\n\tSET NOCOUNT ON;\r\n\tIF (CONTEXT_INFO() IS NULL\r\n\t OR CONTEXT_INFO() NOT IN (HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_DELETE')))\r\n\tBEGIN\r\n\t\tDECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\t\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_DELETE');\r\n\t\tSET CONTEXT_INFO @hash;\r\n\r\n\t\tDECLARE @retry INT = 5;\r\n\t\tWHILE @retry > 0\r\n\t\tBEGIN\r\n\t\t\tBEGIN TRY\r\n\t\t\t\tDECLARE @TranCount INT = @@TRANCOUNT;\r\n\t\t\t\tIF(@TranCount = 0)\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tBEGIN TRANSACTION\r\n\t\t\t\tEND\r\n\r\n\t\t\t\t-- Ersatz für FK_Rechnung_tRechnungPosition_kAuftrag ON DELETE SET NULL\r\n\t\t\t\tUPDATE Rechnung.tRechnungPosition\r\n\t\t\t\tSET tRechnungPosition.kAuftrag = NULL\r\n\t\t\t\tFROM Rechnung.tRechnungPosition\r\n\t\t\t\tJOIN DELETED ON DELETED.kAuftrag = tRechnungPosition.kAuftrag\r\n\r\n\t\t\t\t-- Ersatz für FK_Verkauf_tAuftragkosten_kAuftrag ON DELETE CASCADE\r\n\t\t\t\tDELETE Verkauf.tAuftragkosten\r\n\t\t\t\tFROM Verkauf.tAuftragkosten\r\n\t\t\t\tJOIN DELETED ON DELETED.kAuftrag = tAuftragkosten.kAuftrag\r\n\t\t\t\t\r\n\t\t\t\t--\r\n\t\t\t\t-- Connector\r\n\t\t\t\t--\r\n\t\t\t\t-- Bisherige Queue-Einträge entfernen\r\n\t\t\t\tDELETE dbo.tQueue\r\n\t\t\t\tFROM dbo.tQueue\r\n\t\t\t\tJOIN Deleted ON Deleted.kAuftrag = tQueue.kOption1\r\n\t\t\t\tJOIN dbo.tShop ON tQueue.kShop = tShop.kShop\r\n\t\t\t\tWHERE tQueue.cName = 'tBestellung' AND tShop.nTyp = 1;\r\n\r\n\t\t\t\t-- tQueue schreiben\r\n\t\t\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2, nInBearbeitung)\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tDeleted.kShop,\r\n\t\t\t\t\tDeleted.kPlattform,\r\n\t\t\t\t\t'tBestellung',\r\n\t\t\t\t\t0,\r\n\t\t\t\t\t2,\r\n\t\t\t\t\tDeleted.kAuftrag,\r\n\t\t\t\t\t0,\r\n\t\t\t\t\t0\r\n\t\t\t\tFROM Deleted\r\n\t\t\t\tJOIN dbo.tShop ON Deleted.kShop = tShop.kShop\r\n\t\t\t\tAND tShop.nTyp = 1;\r\n\r\n\t\t\t\t--\r\n\t\t\t\t-- JTL-Shop\r\n\t\t\t\t--\r\n\t\t\t\t-- Bisherige Queue-Einträge entfernen\r\n\t\t\t\tDELETE dbo.tQueue\r\n\t\t\t\tFROM dbo.tQueue\r\n\t\t\t\tJOIN Deleted ON (tQueue.kWert = Deleted.kShopauftrag AND tQueue.nAction IN(2, 5, 6)) OR (tQueue.kWert = Deleted.kAuftrag AND tQueue.nAction IN(1))\r\n\t\t\t\tJOIN dbo.tShop ON tQueue.kShop = tShop.kShop\r\n\t\t\t\tWHERE dbo.tQueue.cName = 'tBestellung' AND tShop.nTyp = 0\r\n\r\n\t\t\t\t-- tQueue schreiben\r\n\t\t\t\tINSERT INTO dbo.tQueue (kShop, kPlattform, cName, kWert, nAction, kOption1, kOption2, nInBearbeitung)\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tDeleted.kShop,\r\n\t\t\t\t\tDeleted.kPlattform,\r\n\t\t\t\t\t'tBestellung',\r\n\t\t\t\t\tDeleted.kShopauftrag,\r\n\t\t\t\t\t2,\r\n\t\t\t\t\t0,\r\n\t\t\t\t\t0,\r\n\t\t\t\t\t0\r\n\t\t\t\tFROM Deleted\r\n\t\t\t\tJOIN dbo.tShop ON Deleted.kShop = tShop.kShop\r\n\t\t\t\tAND tShop.nTyp = 0;\r\n\r\n\t\t\t\tDELETE FROM dbo.tZahlung\r\n\t\t\t\tWHERE ISNULL(tZahlung.kRechnung, 0) = 0 AND ISNULL(tZahlung.kGutschrift, 0) = 0 AND tZahlung.kBestellung IN (SELECT kAuftrag FROM Deleted);\r\n\r\n\t\t\t\tUPDATE dbo.tRMRetoure SET kBestellungUmtausch = 0 WHERE kBestellungUmtausch IN (SELECT kAuftrag FROM Deleted)\r\n\r\n\t\t\t\t-- GoBD-Log schreiben\r\n\t\t\t\tDECLARE @LOGTYP_DELETE TINYINT = 3;\r\n\t\t\t\tINSERT INTO Logging.tAuftragLog\r\n\t\t\t\t\t\t\t(kAuftrag, cAuftragsNr, nAuftragType, nLogTyp, bXML) -- cAppName / dErstelltUtc werden vom INSERT-Trigger der Logtabelle gesetzt\r\n\t\t\t\tSELECT\t\tDISTINCT d.kAuftrag,\r\n\t\t\t\t\t\t\td.cAuftragsNr,\r\n\t\t\t\t\t\t\td.nType,\r\n\t\t\t\t\t\t\t@LOGTYP_DELETE,\r\n\t\t\t\t\t\t\tNULL\r\n\t\t\t\tFROM\t\tDeleted AS d\r\n\t\t\t\tWHERE\t\td.nType IN (0, 1); --- nur 0 = Angebot und 1 = Auftrag\r\n\r\n\t\t\t\tSET @retry = 0;\r\n\t\t\t\tIF(@TranCount = 0)\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tCOMMIT TRANSACTION\r\n\t\t\t\tEND\r\n\t\t\tEND TRY\r\n\t\t\tBEGIN CATCH\r\n\t\t\t\tIF(ERROR_NUMBER() = 1205 AND @TranCount = 0 AND XACT_STATE() <> 0)\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tSET @retry = @retry - 1;\r\n\t\t\t\t\tROLLBACK\r\n\t\t\t\tEND\r\n\t\t\t\tELSE\r\n\t\t\t\tBEGIN\r\n\t\t\t\t\tSET @retry = 0;\r\n\t\t\t\t\tTHROW;\r\n\t\t\t\tEND\r\n\t\t\tEND CATCH\r\n\t\tEND\r\n\r\n\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\tEND\r\n\r\n\t-- Auftrag_Log schreiben\r\n\tIF EXISTS(SELECT * FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren' AND cValue = '1')\r\n\tBEGIN\r\n\t\tDECLARE @kBenutzer INT;\r\n\t\tSET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n\t\tINSERT INTO Verkauf.tAuftrag_Log (kBenutzerLog,\r\n\t\t\t\t\t\t\t\t\t\tdLog,\r\n\t\t\t\t\t\t\t\t\t\tnActionLog,\r\n\t\t\t\t\t\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\t\t\t\t\t\tkBenutzer,\r\n\t\t\t\t\t\t\t\t\t\tkKunde,\r\n\t\t\t\t\t\t\t\t\t\tcAuftragsNr,\r\n\t\t\t\t\t\t\t\t\t\tnType,\r\n\t\t\t\t\t\t\t\t\t\tdErstellt,\r\n\t\t\t\t\t\t\t\t\t\tkShopauftrag,\r\n\t\t\t\t\t\t\t\t\t\tnBeschreibung,\r\n\t\t\t\t\t\t\t\t\t\tcInet,\r\n\t\t\t\t\t\t\t\t\t\tcWaehrung,\r\n\t\t\t\t\t\t\t\t\t\tfFaktor,\r\n\t\t\t\t\t\t\t\t\t\tkShop,\r\n\t\t\t\t\t\t\t\t\t\tkFirmaHistory,\r\n\t\t\t\t\t\t\t\t\t\tkPlattform,\r\n\t\t\t\t\t\t\t\t\t\tkSprache ,\r\n\t\t\t\t\t\t\t\t\t\tcExterneAuftragsnummer,\r\n\t\t\t\t\t\t\t\t\t\tnSteuereinstellung,\r\n\t\t\t\t\t\t\t\t\t\tcEbayUsername,\r\n\t\t\t\t\t\t\t\t\t\tcShopZahlungsmodul,\r\n\t\t\t\t\t\t\t\t\t\tnHatUpload,\r\n\t\t\t\t\t\t\t\t\t\tfZusatzGewicht,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandISO,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandBundeslandKuerzel,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandWaehrung,\r\n\t\t\t\t\t\t\t\t\t\tfVersandlandWaehrungFaktor,\r\n\t\t\t\t\t\t\t\t\t\tkVersandArt,\r\n\t\t\t\t\t\t\t\t\t\tnZahlungszielTage,\r\n\t\t\t\t\t\t\t\t\t\tdVoraussichtlichesLieferdatum,\r\n\t\t\t\t\t\t\t\t\t\tdAuslieferdatum,\r\n\t\t\t\t\t\t\t\t\t\tfSkonto,\r\n\t\t\t\t\t\t\t\t\t\tnSkontoTage,\r\n\t\t\t\t\t\t\t\t\t\tkVorgangsstatus,\r\n\t\t\t\t\t\t\t\t\t\tnStorno,\r\n\t\t\t\t\t\t\t\t\t\tnKomplettAusgeliefert,\r\n\t\t\t\t\t\t\t\t\t\tnLieferPrioritaet,\r\n\t\t\t\t\t\t\t\t\t\tnPremiumVersand,\r\n\t\t\t\t\t\t\t\t\t\tkRueckhaltegrund,\r\n\t\t\t\t\t\t\t\t\t\tkZahlungsart,\r\n\t\t\t\t\t\t\t\t\t\tkWarenlager,\r\n\t\t\t\t\t\t\t\t\t\tnIstExterneRechnung,\r\n\t\t\t\t\t\t\t\t\t\tnIstReadOnly,\r\n\t\t\t\t\t\t\t\t\t\tnMaxLiefertage,\r\n\t\t\t\t\t\t\t\t\t\tcOutboundId,\r\n\t\t\t\t\t\t\t\t\t\tkFulfillmentLieferant,\r\n\t\t\t\t\t\t\t\t\t\tcUstId,\r\n\t\t\t\t\t\t\t\t\t\tnArchiv,\r\n\t\t\t\t\t\t\t\t\t\tnReserviert,\r\n\t\t\t\t\t\t\t\t\t\tnDebitorennr,\r\n\t\t\t\t\t\t\t\t\t\tnAuftragStatus,\r\n\t\t\t\t\t\t\t\t\t\tcKundenAuftragsnummer,\r\n\t\t\t\t\t\t\t\t\t\tcAmazonServiceLevel,\r\n\t\t\t\t\t\t\t\t\t\tbRowversion,\r\n\t\t\t\t\t\t\t\t\t\tdExternesErstelldatum,\r\n\t\t\t\t\t\t\t\t\t\tkFarbe,\r\n\t\t\t\t\t\t\t\t\t\tfFinanzierungskosten,\r\n\t\t\t\t\t\t\t\t\t\tkAuftragQuelle,\r\n\t\t\t\t\t\t\t\t\t\tnAuftragQuelleAktion,\r\n\t\t\t\t\t\t\t\t\t\tkArtikelKarton,\r\n\t\t\t\t\t\t\t\t\t\tcKundenNr,\r\n\t\t\t\t\t\t\t\t\t\tkKundengruppe,\r\n\t\t\t\t\t\t\t\t\t\tdAuslieferungAb,\r\n\t\t\t\t\t\t\t\t\t\tkAmazonUser,\r\n\t\t\t\t\t\t\t\t\t\tcKundeUstId,\r\n\t\t\t\t\t\t\t\t\t\tnPending,\r\n kBenutzerErstellt,\r\n nSteuersonderbehandlung)\r\n\t\tSELECT\t@kBenutzer,\r\n\t\t\t\tGETDATE(),\r\n\t\t\t\t2,\r\n\t\t\t\tDeleted.kAuftrag,\r\n\t\t\t\tDeleted.kBenutzer,\r\n\t\t\t\tDeleted.kKunde,\r\n\t\t\t\tDeleted.cAuftragsNr,\r\n\t\t\t\tDeleted.nType,\r\n\t\t\t\tDeleted.dErstellt,\r\n\t\t\t\tDeleted.kShopAuftrag,\r\n\t\t\t\tDeleted.nBeschreibung,\r\n\t\t\t\tDeleted.cInet,\r\n\t\t\t\tDeleted.cWaehrung,\r\n\t\t\t\tDeleted.fFaktor,\r\n\t\t\t\tDeleted.kShop,\r\n\t\t\t\tDeleted.kFirmaHistory,\r\n\t\t\t\tDeleted.kPlattform,\r\n\t\t\t\tDeleted.kSprache,\r\n\t\t\t\tDeleted.cExterneAuftragsnummer,\r\n\t\t\t\tDeleted.nSteuereinstellung,\r\n\t\t\t\tDeleted.cEbayUsername,\r\n\t\t\t\tDeleted.cShopZahlungsmodul,\r\n\t\t\t\tDeleted.nHatUpload,\r\n\t\t\t\tDeleted.fZusatzGewicht,\r\n\t\t\t\tDeleted.cVersandlandISO,\r\n\t\t\t\tDeleted.cVersandlandBundeslandKuerzel ,\r\n\t\t\t\tDeleted.cVersandlandWaehrung,\r\n\t\t\t\tDeleted.fVersandlandWaehrungFaktor,\r\n\t\t\t\tDeleted.kVersandArt,\r\n\t\t\t\tDeleted.nZahlungszielTage,\r\n\t\t\t\tDeleted.dVoraussichtlichesLieferdatum,\r\n\t\t\t\tDeleted.dAuslieferdatum,\r\n\t\t\t\tDeleted.fSkonto,\r\n\t\t\t\tDeleted.nSkontoTage,\r\n\t\t\t\tDeleted.kVorgangsstatus,\r\n\t\t\t\tDeleted.nStorno,\r\n\t\t\t\tDeleted.nKomplettAusgeliefert,\r\n\t\t\t\tDeleted.nLieferPrioritaet,\r\n\t\t\t\tDeleted.nPremiumVersand,\r\n\t\t\t\tDeleted.kRueckhaltegrund,\r\n\t\t\t\tDeleted.kZahlungsart,\r\n\t\t\t\tDeleted.kWarenlager,\r\n\t\t\t\tDeleted.nIstExterneRechnung,\r\n\t\t\t\tDeleted.nIstReadOnly,\r\n\t\t\t\tDeleted.nMaxLiefertage,\r\n\t\t\t\tDeleted.cOutboundId,\r\n\t\t\t\tDeleted.kFulfillmentLieferant,\r\n\t\t\t\tDeleted.cUstId,\r\n\t\t\t\tDeleted.nArchiv,\r\n\t\t\t\tDeleted.nReserviert,\r\n\t\t\t\tDeleted.nDebitorennr,\r\n\t\t\t\tDeleted.nAuftragStatus,\r\n\t\t\t\tDeleted.cKundenAuftragsnummer,\r\n\t\t\t\tDeleted.cAmazonServiceLevel,\r\n\t\t\t\tDeleted.bRowversion,\r\n\t\t\t\tDeleted.dExternesErstelldatum,\r\n\t\t\t\tDeleted.kFarbe,\r\n\t\t\t\tDeleted.fFinanzierungskosten,\r\n\t\t\t\tDeleted.kAuftragQuelle,\r\n\t\t\t\tDeleted.nAuftragQuelleAktion,\r\n\t\t\t\tDeleted.kArtikelKarton,\r\n\t\t\t\tDeleted.cKundenNr,\r\n\t\t\t\tDeleted.kKundengruppe,\r\n\t\t\t\tDeleted.dAuslieferungAb,\r\n\t\t\t\tDeleted.kAmazonUser,\r\n\t\t\t\tDeleted.cKundeUstId,\r\n\t\t\t\tDeleted.nPending,\r\n\t\t\t\tDeleted.kBenutzerErstellt,\r\n\t\t\t\tDeleted.nSteuersonderbehandlung\r\n\t\tFROM Deleted;\r\n\tEND\r\n\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"triggerName": "tgr_Verkauf_tAuftrag_INSERT",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftrag_INSERT]\r\nON [Verkauf].[tAuftrag]\r\nAFTER INSERT\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n DECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n DECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_INSERT');\r\n SET CONTEXT_INFO @hash;\r\n\r\n -- Kundenhistorie schreiben\r\n INSERT INTO Kunde.tHistorie\r\n (\r\n kKunde,\r\n kAuftrag,\r\n kVorgang,\r\n kKey,\r\n cValue1,\r\n cValue2,\r\n cValue3,\r\n dErstellt,\r\n kBenutzer,\r\n fValue1,\r\n fValue2\r\n )\r\n SELECT Inserted.kKunde,\r\n Inserted.kAuftrag,\r\n CASE\r\n WHEN Inserted.nType = 0 THEN\r\n 18 --Angebote\r\n WHEN Inserted.nType = 3 THEN\r\n 4 --Abonnements\r\n ELSE\r\n 1 --Aufträge\r\n END,\r\n Inserted.kAuftrag,\r\n Inserted.cAuftragsNr,\r\n NULL,\r\n NULL,\r\n GETDATE(),\r\n Inserted.kBenutzer,\r\n NULL,\r\n NULL\r\n FROM Inserted\r\n WHERE Inserted.nType IN ( 0, 1, 3 )\r\n AND Inserted.kKunde IS NOT NULL;\r\n\r\n -- dErstelltWawi überschreiben\r\n UPDATE tAuftrag\r\n SET tAuftrag.dErstelltWawi = GETDATE()\r\n FROM Verkauf.tAuftrag\r\n JOIN Inserted\r\n ON Inserted.kAuftrag = tAuftrag.kAuftrag;\r\n\r\n\t-- Neuen Auftrag in Feature-Flag-Tabelle eintragen und anhand tPlattformAuftragFeatures fuellen\r\n\tINSERT INTO Verkauf.tAuftragFeatures\r\n\t(\r\n\t\tkAuftrag,\r\n\t\tnBearbeiten,\r\n\t\tnBearbeitenMitWarnung,\r\n\t\tnLoeschen,\r\n\t\tnStornieren,\r\n\t\tnTeilrechnungErstellen,\r\n\t\tnRechnungErstellen,\r\n\t\tnZusammenfassen,\r\n\t\tnSplitten\r\n\t)\r\n\tSELECT\r\n\t\tInserted.kAuftrag AS kAuftrag,\r\n\t\tISNULL(tPlattformAuftragFeatures.nBearbeiten, 0) AS nBearbeiten,\r\n\t\tISNULL(tPlattformAuftragFeatures.nBearbeitenMitWarnung, 0) AS nBearbeitenMitWarnung,\r\n\t\tISNULL(tPlattformAuftragFeatures.nLoeschen, 0) AS nLoeschen,\r\n\t\tISNULL(tPlattformAuftragFeatures.nStornieren, 0) AS nStornieren,\r\n\t\tISNULL(tPlattformAuftragFeatures.nTeilrechnungErstellen, 0) AS nTeilrechnungErstellen,\r\n\t\tISNULL(tPlattformAuftragFeatures.nRechnungErstellen, 0) AS nRechnungErstellen,\r\n\t\tISNULL(tPlattformAuftragFeatures.nZusammenfassen, 0) AS nZusammenfassen,\r\n\t\tISNULL(tPlattformAuftragFeatures.nSplitten, 0) AS nSplitten\r\n\tFROM Inserted\r\n\tJOIN dbo.tPlattform ON tPlattform.nPlattform = Inserted.kPlattform\r\n\tLEFT JOIN Verkauf.tPlattformAuftragFeatures ON tPlattform.nTyp = tPlattformAuftragFeatures.nTyp\r\n\t\t\t\t\t\t\t\t\t\t\t\t AND\r\n\t\t\t\t\t\t\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t tPlattformAuftragFeatures.kShop = Inserted.kShop\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t OR tPlattformAuftragFeatures.kShop IS NULL\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND Inserted.kShop = 0\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t OR tPlattformAuftragFeatures.kShop IS NULL\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND Inserted.kShop IS NULL\r\n\t\t\t\t\t\t\t\t\t\t\t\t );\r\n\r\n -- Auftrag aktualisieren\r\n UPDATE tAuftrag\r\n SET nAuftragStatus = 255, -- Auftragstatus setzen\r\n tAuftrag.nReserviert = CASE\r\n WHEN INSERTED.nType IN ( 1, 2 ) THEN\r\n 1\r\n ELSE\r\n 0\r\n END -- Reserviert-Kennzeichen pruefen\r\n FROM Verkauf.tAuftrag\r\n JOIN Inserted\r\n ON Inserted.kAuftrag = tAuftrag.kAuftrag;\r\n\r\n SET CONTEXT_INFO @OldContextInfo;\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftrag",
|
|
"triggerName": "tgr_Verkauf_tAuftrag_UPDATE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftrag_UPDATE]\r\nON [Verkauf].[tAuftrag]\r\nAFTER UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\n\r\nBEGIN\r\n\tIF (CONTEXT_INFO() IN (HASHBYTES('SHA1', 'Verkauf.spAuftragEckdatenBerechnen')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_INSERT')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_UPDATE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_DELETE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_INSERT')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_UPDATE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_DELETE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragAdresse_DELETE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPositionTeilmengen_INSERT')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPositionTeilmengen_UPDATE')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'jtlActionValidator_tShop')\r\n\t\t\t\t\t\t ))\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND\r\n\r\n\tIF (CONTEXT_INFO() IS NULL \r\n\t OR CONTEXT_INFO() NOT IN (HASHBYTES('SHA1', 'Verkauf.spAuftragStorno')\r\n\t\t\t\t\t\t\t , HASHBYTES('SHA1', 'Verkauf.spAuftragStornoEntfernen')\r\n\t\t\t\t\t\t ))\r\n\tBEGIN\r\n\t\tIF UPDATE(nStorno) AND EXISTS(SELECT 1 FROM INSERTED JOIN DELETED ON DELETED.kAuftrag = INSERTED.kAuftrag WHERE INSERTED.nStorno <> DELETED.nStorno)\r\n\t\tBEGIN\r\n\t\t\tROLLBACK;\r\n\t\t\tRAISERROR (N'Das Setzen oder Entfernen eines Auftragsstornos ist nur noch über die SPs Verkauf.spAuftragStorno und Verkauf.spAuftragStornoEntfernen möglich.', 15, 1);\r\n\t\tEND\r\n\tEND\r\n\r\n DECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftrag_UPDATE');\r\n\tSET CONTEXT_INFO @hash;\r\n\r\n\t-- Kundenhistorie schreiben: Auftrag zurueckgehalten / nicht mehr zurueckgehalten\r\n\tDECLARE @kBenutzer INT;\r\n\tSET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n\r\n\t-- Kundenhistorie für Pendingaufträge schreiben, wenn Kunde hinzugefuegt wird\r\n\tIF EXISTS (SELECT 1\tFROM Inserted\r\n\t\t\t\tJOIN Deleted ON Deleted.kAuftrag = Inserted.kAuftrag\r\n\t\t\t\tWHERE Deleted.kKunde IS NULL\r\n\t\t\t\t\tAND Inserted.kKunde IS NOT NULL\r\n\t\t\t\t\tAND Inserted.nType IN (0, 1, 3))\r\n BEGIN\r\n INSERT INTO Kunde.tHistorie (kKunde, kAuftrag, kVorgang, kKey, cValue1, cValue2, cValue3, dErstellt, kBenutzer,\r\n fValue1, fValue2)\r\n SELECT\r\n Inserted.kKunde,\r\n Inserted.kAuftrag,\r\n CASE\r\n WHEN Inserted.nType = 0 THEN 18 --Angebote\r\n WHEN Inserted.nType = 3 THEN 4 --Abonnements\r\n ELSE 1 --Aufträge\r\n END,\r\n Inserted.kAuftrag,\r\n Inserted.cAuftragsNr,\r\n NULL,\r\n NULL,\r\n GETDATE(),\r\n ISNULL(@kBenutzer, Inserted.kBenutzer),\r\n NULL,\r\n NULL\r\n FROM Inserted\r\n JOIN Deleted ON Deleted.kAuftrag = Inserted.kAuftrag\r\n WHERE Deleted.kKunde IS NULL\r\n AND Inserted.kKunde IS NOT NULL\r\n AND Inserted.nType IN (0, 1, 3);\r\n END\r\n\t \r\n\tINSERT INTO Kunde.tHistorie (kKunde, kAuftrag, kVorgang, kKey, cValue1, cValue2, cValue3, dErstellt, kBenutzer, fValue1, fValue2)\r\n\tSELECT Inserted.kKunde, Inserted.kAuftrag, 23, Inserted.kAuftrag, Inserted.cAuftragsNr, Inserted.kRueckhaltegrund, NULL, GETDATE(), ISNULL(@kBenutzer, 0), Inserted.nType, NULL\r\n\tFROM Inserted\r\n\tJOIN Deleted ON Deleted.kAuftrag = Inserted.kAuftrag\r\n\tWHERE ISNULL(Inserted.kRueckhaltegrund, 0) <> ISNULL(Deleted.kRueckhaltegrund, 0) AND Inserted.kKunde IS NOT NULL;\r\n\r\n\t-- Auftrag aktualisieren\r\n\tUPDATE tAuftrag\r\n\tSET tAuftrag.nReserviert = CASE WHEN INSERTED.nType IN (1,2) THEN 1 ELSE 0 END -- Reserviert-Kennzeichen pruefen\r\n\tFROM Verkauf.tAuftrag\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftrag.kAuftrag;\r\n\r\n\t-- Auftragstatus setzen\r\n\tUPDATE tAuftrag\r\n\tSET tAuftrag.nAuftragStatus = 255\r\n\tFROM Verkauf.tAuftrag\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftrag.kAuftrag\r\n\tJOIN Deleted ON Deleted.kAuftrag = tAuftrag.kAuftrag\r\n\tWHERE tAuftrag.nAuftragStatus <> 255\r\n\t\tAND (Inserted.kKunde <> Deleted.kKunde\r\n\t\t\tOR Inserted.kFirmaHistory <> Deleted.kFirmaHistory\r\n\t\t\tOR Inserted.cVersandlandISO <> Deleted.cVersandlandISO\r\n\t\t\tOR Inserted.cVersandlandBundeslandKuerzel <> Deleted.cVersandlandBundeslandKuerzel\r\n\t\t\tOR Inserted.nStorno <> Deleted.nStorno\r\n\t\t\tOR Inserted.kZahlungsart <> Deleted.kZahlungsart\r\n\t\t\tOR Inserted.kWarenlager <> Deleted.kWarenlager\r\n\t\t\tOR Inserted.kKundengruppe <> Deleted.kKundengruppe\r\n\t\t\t);\r\n\r\n\t-- Auftrag_Log schreiben\r\n\tIF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n\tBEGIN\r\n\t\tINSERT INTO Verkauf.tAuftrag_Log (kBenutzerLog,\r\n\t\t\t\t\t\t\t\t\t\tdLog,\r\n\t\t\t\t\t\t\t\t\t\tnActionLog,\r\n\t\t\t\t\t\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\t\t\t\t\t\tkBenutzer,\r\n\t\t\t\t\t\t\t\t\t\tkKunde,\r\n\t\t\t\t\t\t\t\t\t\tcAuftragsNr,\r\n\t\t\t\t\t\t\t\t\t\tnType,\r\n\t\t\t\t\t\t\t\t\t\tdErstellt,\r\n\t\t\t\t\t\t\t\t\t\tkShopauftrag,\r\n\t\t\t\t\t\t\t\t\t\tnBeschreibung,\r\n\t\t\t\t\t\t\t\t\t\tcInet,\r\n\t\t\t\t\t\t\t\t\t\tcWaehrung,\r\n\t\t\t\t\t\t\t\t\t\tfFaktor,\r\n\t\t\t\t\t\t\t\t\t\tkShop,\r\n\t\t\t\t\t\t\t\t\t\tkFirmaHistory,\r\n\t\t\t\t\t\t\t\t\t\tkPlattform,\r\n\t\t\t\t\t\t\t\t\t\tkSprache ,\r\n\t\t\t\t\t\t\t\t\t\tcExterneAuftragsnummer,\r\n\t\t\t\t\t\t\t\t\t\tnSteuereinstellung,\r\n\t\t\t\t\t\t\t\t\t\tcEbayUsername,\r\n\t\t\t\t\t\t\t\t\t\tcShopZahlungsmodul,\r\n\t\t\t\t\t\t\t\t\t\tnHatUpload,\r\n\t\t\t\t\t\t\t\t\t\tfZusatzGewicht,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandISO,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandBundeslandKuerzel,\r\n\t\t\t\t\t\t\t\t\t\tcVersandlandWaehrung,\r\n\t\t\t\t\t\t\t\t\t\tfVersandlandWaehrungFaktor,\r\n\t\t\t\t\t\t\t\t\t\tkVersandArt,\r\n\t\t\t\t\t\t\t\t\t\tnZahlungszielTage,\r\n\t\t\t\t\t\t\t\t\t\tdVoraussichtlichesLieferdatum,\r\n\t\t\t\t\t\t\t\t\t\tdAuslieferdatum,\r\n\t\t\t\t\t\t\t\t\t\tfSkonto,\r\n\t\t\t\t\t\t\t\t\t\tnSkontoTage,\r\n\t\t\t\t\t\t\t\t\t\tkVorgangsstatus,\r\n\t\t\t\t\t\t\t\t\t\tnStorno,\r\n\t\t\t\t\t\t\t\t\t\tnKomplettAusgeliefert,\r\n\t\t\t\t\t\t\t\t\t\tnLieferPrioritaet,\r\n\t\t\t\t\t\t\t\t\t\tnPremiumVersand,\r\n\t\t\t\t\t\t\t\t\t\tkRueckhaltegrund,\r\n\t\t\t\t\t\t\t\t\t\tkZahlungsart,\r\n\t\t\t\t\t\t\t\t\t\tkWarenlager,\r\n\t\t\t\t\t\t\t\t\t\tnIstExterneRechnung,\r\n\t\t\t\t\t\t\t\t\t\tnIstReadOnly,\r\n\t\t\t\t\t\t\t\t\t\tnMaxLiefertage,\r\n\t\t\t\t\t\t\t\t\t\tcOutboundId,\r\n\t\t\t\t\t\t\t\t\t\tkFulfillmentLieferant,\r\n\t\t\t\t\t\t\t\t\t\tcUstId,\r\n\t\t\t\t\t\t\t\t\t\tnArchiv,\r\n\t\t\t\t\t\t\t\t\t\tnReserviert,\r\n\t\t\t\t\t\t\t\t\t\tnDebitorennr,\r\n\t\t\t\t\t\t\t\t\t\tnAuftragStatus,\r\n\t\t\t\t\t\t\t\t\t\tcKundenAuftragsnummer,\r\n\t\t\t\t\t\t\t\t\t\tcAmazonServiceLevel,\r\n\t\t\t\t\t\t\t\t\t\tbRowversion,\r\n\t\t\t\t\t\t\t\t\t\tdExternesErstelldatum,\r\n\t\t\t\t\t\t\t\t\t\tkFarbe,\r\n\t\t\t\t\t\t\t\t\t\tfFinanzierungskosten,\r\n\t\t\t\t\t\t\t\t\t\tkAuftragQuelle,\r\n\t\t\t\t\t\t\t\t\t\tnAuftragQuelleAktion,\r\n\t\t\t\t\t\t\t\t\t\tkArtikelKarton,\r\n\t\t\t\t\t\t\t\t\t\tcKundenNr,\r\n\t\t\t\t\t\t\t\t\t\tkKundengruppe,\r\n\t\t\t\t\t\t\t\t\t\tdAuslieferungAb,\r\n\t\t\t\t\t\t\t\t\t\tkAmazonUser,\r\n\t\t\t\t\t\t\t\t\t\tcKundeUstId,\r\n\t\t\t\t\t\t\t\t\t\tnPending,\r\n kBenutzerErstellt,\r\n nSteuersonderbehandlung)\r\n\t\tSELECT\t@kBenutzer,\r\n\t\t\t\tGETDATE(),\r\n\t\t\t\t1,\r\n\t\t\t\tDeleted.kAuftrag,\r\n\t\t\t\tDeleted.kBenutzer,\r\n\t\t\t\tDeleted.kKunde,\r\n\t\t\t\tDeleted.cAuftragsNr,\r\n\t\t\t\tDeleted.nType,\r\n\t\t\t\tDeleted.dErstellt,\r\n\t\t\t\tDeleted.kShopAuftrag,\r\n\t\t\t\tDeleted.nBeschreibung,\r\n\t\t\t\tDeleted.cInet,\r\n\t\t\t\tDeleted.cWaehrung,\r\n\t\t\t\tDeleted.fFaktor,\r\n\t\t\t\tDeleted.kShop,\r\n\t\t\t\tDeleted.kFirmaHistory,\r\n\t\t\t\tDeleted.kPlattform,\r\n\t\t\t\tDeleted.kSprache,\r\n\t\t\t\tDeleted.cExterneAuftragsnummer,\r\n\t\t\t\tDeleted.nSteuereinstellung,\r\n\t\t\t\tDeleted.cEbayUsername,\r\n\t\t\t\tDeleted.cShopZahlungsmodul,\r\n\t\t\t\tDeleted.nHatUpload,\r\n\t\t\t\tDeleted.fZusatzGewicht,\r\n\t\t\t\tDeleted.cVersandlandISO,\r\n\t\t\t\tDeleted.cVersandlandBundeslandKuerzel ,\r\n\t\t\t\tDeleted.cVersandlandWaehrung,\r\n\t\t\t\tDeleted.fVersandlandWaehrungFaktor,\r\n\t\t\t\tDeleted.kVersandArt,\r\n\t\t\t\tDeleted.nZahlungszielTage, \r\n\t\t\t\tDeleted.dVoraussichtlichesLieferdatum,\r\n\t\t\t\tDeleted.dAuslieferdatum,\r\n\t\t\t\tDeleted.fSkonto,\r\n\t\t\t\tDeleted.nSkontoTage,\r\n\t\t\t\tDeleted.kVorgangsstatus,\r\n\t\t\t\tDeleted.nStorno,\r\n\t\t\t\tDeleted.nKomplettAusgeliefert,\r\n\t\t\t\tDeleted.nLieferPrioritaet,\r\n\t\t\t\tDeleted.nPremiumVersand,\r\n\t\t\t\tDeleted.kRueckhaltegrund,\r\n\t\t\t\tDeleted.kZahlungsart,\r\n\t\t\t\tDeleted.kWarenlager,\r\n\t\t\t\tDeleted.nIstExterneRechnung,\r\n\t\t\t\tDeleted.nIstReadOnly,\r\n\t\t\t\tDeleted.nMaxLiefertage,\r\n\t\t\t\tDeleted.cOutboundId,\r\n\t\t\t\tDeleted.kFulfillmentLieferant,\r\n\t\t\t\tDeleted.cUstId,\r\n\t\t\t\tDeleted.nArchiv,\r\n\t\t\t\tDeleted.nReserviert,\r\n\t\t\t\tDeleted.nDebitorennr,\r\n\t\t\t\tDeleted.nAuftragStatus,\r\n\t\t\t\tDeleted.cKundenAuftragsnummer,\r\n\t\t\t\tDeleted.cAmazonServiceLevel,\r\n\t\t\t\tDeleted.bRowversion,\r\n\t\t\t\tDeleted.dExternesErstelldatum,\r\n\t\t\t\tDeleted.kFarbe,\r\n\t\t\t\tDeleted.fFinanzierungskosten,\r\n\t\t\t\tDeleted.kAuftragQuelle,\r\n\t\t\t\tDeleted.nAuftragQuelleAktion,\r\n\t\t\t\tDeleted.kArtikelKarton,\r\n\t\t\t\tDeleted.cKundenNr,\r\n\t\t\t\tDeleted.kKundengruppe,\r\n\t\t\t\tDeleted.dAuslieferungAb,\r\n\t\t\t\tDeleted.kAmazonUser,\r\n\t\t\t\tDeleted.cKundeUstId,\r\n\t\t\t\tDeleted.nPending,\r\n\t\t\t\tDeleted.kBenutzerErstellt,\r\n\t\t\t\tDeleted.nSteuersonderbehandlung\r\n\t\tFROM Deleted\r\n\t\tJOIN Inserted ON Inserted.kAuftrag = Deleted.kAuftrag\r\n\t\tWHERE Deleted.kBenutzer <> Inserted.kBenutzer OR\r\n\t\t\t\tISNULL(Deleted.kKunde, '') <> ISNULL(Inserted.kKunde, '') OR\r\n\t\t\t\tDeleted.cAuftragsNr <> Inserted.cAuftragsNr OR\r\n\t\t\t\tDeleted.nType <> Inserted.nType OR\r\n\t\t\t\tDeleted.dErstellt <> Inserted.dErstellt OR\r\n\t\t\t\tISNULL(Deleted.kShopAuftrag, '') <> ISNULL(Inserted.kShopauftrag, '') OR\r\n\t\t\t\tDeleted.nBeschreibung <> Inserted.nBeschreibung OR\r\n\t\t\t\tISNULL(Deleted.cInet, '') <> ISNULL(Inserted.cInet, '') OR\r\n\t\t\t\tISNULL(Deleted.cWaehrung, '') <> ISNULL(Inserted.cWaehrung, '') OR\r\n\t\t\t\tDeleted.fFaktor <> Inserted.fFaktor OR\r\n\t\t\t\tISNULL(Deleted.kShop, '') <> ISNULL(Inserted.kShop, '') OR\r\n\t\t\t\tDeleted.kFirmaHistory <> Inserted.kFirmaHistory OR\r\n\t\t\t\tISNULL(Deleted.kPlattform, '') <> ISNULL(Inserted.kPlattform, '') OR\r\n\t\t\t\tDeleted.kSprache <> Inserted.kSprache OR\r\n\t\t\t\tISNULL(Deleted.cExterneAuftragsnummer, '') <> ISNULL(Inserted.cExterneAuftragsnummer, '') OR\r\n\t\t\t\tISNULL(Deleted.nSteuereinstellung, '') <> ISNULL(Inserted.nSteuereinstellung, '') OR\r\n\t\t\t\tISNULL(Deleted.cEbayUsername, '') <> ISNULL(Inserted.cEbayUsername, '') OR\r\n\t\t\t\tISNULL(Deleted.cShopZahlungsmodul, '') <> ISNULL(Inserted.cShopZahlungsmodul, '') OR\r\n\t\t\t\tDeleted.nHatUpload <> Inserted.nHatUpload OR\r\n\t\t\t\tDeleted.fZusatzGewicht <> Inserted.fZusatzGewicht OR\r\n\t\t\t\tISNULL(Deleted.cVersandlandISO, '') <> ISNULL(Inserted.cVersandlandISO, '') OR\r\n\t\t\t\tISNULL(Deleted.cVersandlandBundeslandKuerzel, '') <> ISNULL(Inserted.cVersandlandBundeslandKuerzel, '') OR\r\n\t\t\t\tDeleted.cVersandlandWaehrung <> Inserted.cVersandlandWaehrung OR\r\n\t\t\t\tDeleted.fVersandlandWaehrungFaktor <> Inserted.fVersandlandWaehrungFaktor OR\r\n\t\t\t\tISNULL(Deleted.kVersandArt, '') <> ISNULL(Inserted.kVersandArt, '') OR\r\n\t\t\t\tISNULL(Deleted.nZahlungszielTage, '') <> ISNULL(Inserted.nZahlungszielTage, '') OR\r\n\t\t\t\tISNULL(Deleted.dVoraussichtlichesLieferdatum, '') <> ISNULL(Inserted.dVoraussichtlichesLieferdatum, '') OR\r\n\t\t\t\tISNULL(Deleted.dAuslieferdatum, '') <> ISNULL(Inserted.dAuslieferdatum, '') OR\r\n\t\t\t\t(Deleted.fSkonto IS NULL AND Inserted.fSkonto IS NOT NULL) OR \r\n\t\t\t\t(Deleted.fSkonto IS NOT NULL AND Inserted.fSkonto IS NULL) OR \r\n\t\t\t\tISNULL(Deleted.fSkonto, 0) <> ISNULL(Inserted.fSkonto, 0) OR\r\n\t\t\t\tISNULL(Deleted.nSkontoTage, -1) <> ISNULL(Inserted.nSkontoTage, -1) OR\r\n\t\t\t\tISNULL(Deleted.kVorgangsstatus, '') <> ISNULL(Inserted.kVorgangsstatus, '') OR\r\n\t\t\t\tDeleted.nStorno <> Inserted.nStorno OR\r\n\t\t\t\tDeleted.nKomplettAusgeliefert <> Inserted.nKomplettAusgeliefert OR\r\n\t\t\t\tDeleted.nLieferPrioritaet <> Inserted.nLieferPrioritaet OR\r\n\t\t\t\tDeleted.nPremiumVersand <> Inserted.nPremiumVersand OR\r\n\t\t\t\tISNULL(Deleted.kRueckhaltegrund, '') <> ISNULL(Inserted.kRueckhaltegrund, '') OR\r\n\t\t\t\tISNULL(Deleted.kZahlungsart, '') <> ISNULL(Inserted.kZahlungsart, '') OR\r\n\t\t\t\tISNULL(Deleted.kWarenlager, '') <> ISNULL(Inserted.kWarenlager, '') OR\r\n\t\t\t\tDeleted.nIstExterneRechnung <> Inserted.nIstExterneRechnung OR\r\n\t\t\t\tDeleted.nIstReadOnly <> Inserted.nIstReadOnly OR\r\n\t\t\t\tISNULL(Deleted.nMaxLiefertage, '') <> ISNULL(Inserted.nMaxLiefertage, '') OR\r\n\t\t\t\tISNULL(Deleted.cOutboundId, '') <> ISNULL(Inserted.cOutboundId, '') OR\r\n\t\t\t\tISNULL(Deleted.kFulfillmentLieferant, '') <> ISNULL(Inserted.kFulfillmentLieferant, '') OR\r\n\t\t\t\tISNULL(Deleted.cUstId, '') <> ISNULL(Inserted.cUstId, '') OR\r\n\t\t\t\tDeleted.nArchiv <> Inserted.nArchiv OR\r\n\t\t\t\tDeleted.nReserviert <> Inserted.nReserviert OR\r\n\t\t\t\tISNULL(Deleted.nDebitorennr, '') <> ISNULL(Inserted.nDebitorennr, '') OR\r\n\t\t\t\tISNULL(Deleted.cKundenAuftragsnummer, '') <> ISNULL(Inserted.cKundenAuftragsnummer, '') OR\r\n\t\t\t\tISNULL(Deleted.cAmazonServiceLevel, '') <> ISNULL(Inserted.cAmazonServiceLevel, '') OR\r\n\t\t\t\tISNULL(Deleted.dExternesErstelldatum, '') <> ISNULL(Inserted.dExternesErstelldatum, '') OR\r\n\t\t\t\tISNULL(Deleted.kFarbe, '') <> ISNULL(Inserted.kFarbe, '') OR\r\n\t\t\t\tDeleted.fFinanzierungskosten <> Inserted.fFinanzierungskosten OR\r\n\t\t\t\tISNULL(Deleted.kAuftragQuelle, 0) <> ISNULL(Inserted.kAuftragQuelle, 0) OR\r\n\t\t\t\tISNULL(Deleted.nAuftragQuelleAktion, 0) <> ISNULL(Inserted.nAuftragQuelleAktion, 0) OR\r\n\t\t\t\tISNULL(Deleted.kArtikelKarton, 0) <> ISNULL(Inserted.kArtikelKarton, 0) OR\r\n\t\t\t\tISNULL(Deleted.cKundenNr, '') <> ISNULL(Inserted.cKundenNr, '') OR\r\n\t\t\t\tISNULL(Deleted.kKundengruppe, '') <> ISNULL(Inserted.kKundengruppe, '') OR\r\n\t\t\t\tISNULL(Deleted.dAuslieferungAb, '') <> ISNULL(Inserted.dAuslieferungAb, '') OR\r\n\t\t\t\tISNULL(Deleted.kAmazonUser, 0) <> ISNULL(Inserted.kAmazonUser, 0) OR\r\n\t\t\t\tISNULL(Deleted.cKundeUstId, '') <> ISNULL(Inserted.cKundeUstId, '') OR\r\n\t\t\t\tDeleted.nPending <> Inserted.nPending OR\r\n\t\t\t\tDeleted.kBenutzerErstellt <> Inserted.kBenutzerErstellt OR\r\n\t\t\t\tDeleted.nSteuersonderbehandlung <> Inserted.nSteuersonderbehandlung;\r\n\tEND\r\n\t\t\t\r\n\tSET CONTEXT_INFO @OldContextInfo;\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"triggerName": "tgr_Verkauf_tAuftragAdresse_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragAdresse_DELETE]\r\nON [Verkauf].[tAuftragAdresse]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tDECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragAdresse_DELETE');\r\n\tSET CONTEXT_INFO @hash;\r\n\r\n\t-- Auftragstatus setzen\r\n\tUPDATE tAuftrag\r\n\tSET tAuftrag.nAuftragStatus = 255\r\n\tFROM Verkauf.tAuftrag\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftrag.kAuftrag\r\n\tJOIN Deleted ON Deleted.kAuftrag = tAuftrag.kAuftrag\r\n\tWHERE tAuftrag.nAuftragStatus <> 255;\r\n\r\n\tSET CONTEXT_INFO @OldContextInfo;\r\n\r\n\t-- Logging\r\n\tIF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n\tBEGIN\r\n\t\tDECLARE @kBenutzer INT;\r\n\t\tSET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n\t\tINSERT INTO Verkauf.tAuftragAdresse_Log\r\n\t\t(\r\n\t\t\tkBenutzerLog,\r\n\t\t\tdLog,\r\n\t\t\tnActionLog,\r\n\t\t\tkAuftrag,\r\n\t\t\tkKunde,\r\n\t\t\tcFirma,\r\n\t\t\tcAnrede,\r\n\t\t\tcTitel,\r\n\t\t\tcVorname,\r\n\t\t\tcName,\r\n\t\t\tcStrasse,\r\n\t\t\tcPLZ,\r\n\t\t\tcOrt,\r\n\t\t\tcLand,\r\n\t\t\tcTel,\r\n\t\t\tcZusatz,\r\n\t\t\tcAdressZusatz,\r\n\t\t\tcPostID,\r\n\t\t\tcMobil,\r\n\t\t\tcMail,\r\n\t\t\tcFax,\r\n\t\t\tcBundesland,\r\n\t\t\tcISO,\r\n\t\t\tnTyp,\r\n\t\t\tbRowversion,\r\n\t\t\tnZolldokumenteErforderlich\r\n\t\t)\r\n\t\tSELECT\r\n\t\t\t@kBenutzer,\r\n\t\t\tGETDATE(),\r\n\t\t\t2,\r\n\t\t\tDeleted.kAuftrag,\r\n\t\t\tDeleted.kKunde,\r\n\t\t\tDeleted.cFirma,\r\n\t\t\tDeleted.cAnrede,\r\n\t\t\tDeleted.cTitel,\r\n\t\t\tDeleted.cVorname,\r\n\t\t\tDeleted.cName,\r\n\t\t\tDeleted.cStrasse,\r\n\t\t\tDeleted.cPLZ,\r\n\t\t\tDeleted.cOrt,\r\n\t\t\tDeleted.cLand,\r\n\t\t\tDeleted.cTel,\r\n\t\t\tDeleted.cZusatz,\r\n\t\t\tDeleted.cAdressZusatz,\r\n\t\t\tDeleted.cPostID,\r\n\t\t\tDeleted.cMobil,\r\n\t\t\tDeleted.cMail,\r\n\t\t\tDeleted.cFax,\r\n\t\t\tDeleted.cBundesland,\r\n\t\t\tDeleted.cISO,\r\n\t\t\tDeleted.nTyp,\r\n\t\t\tDeleted.bRowversion,\r\n\t\t\tDeleted.nZolldokumenteErforderlich\r\n\t\tFROM Deleted;\r\n\tEND\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"triggerName": "tgr_Verkauf_tAuftragAdresse_INSERT",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragAdresse_INSERT]\r\nON [Verkauf].[tAuftragAdresse]\r\nAFTER INSERT\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tUPDATE Verkauf.tAuftragAdresse\r\n\tSET tAuftragAdresse.nZolldokumenteErforderlich = CASE WHEN tland.nEU = 1 THEN 0 ELSE 1 END\r\n\tFROM Verkauf.tAuftragAdresse\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftragAdresse.kAuftrag AND Inserted.nTyp = tAuftragAdresse.nTyp\r\n\tJOIN dbo.tland ON tland.cISO = tAuftragAdresse.cISO;\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragAdresse",
|
|
"triggerName": "tgr_Verkauf_tAuftragAdresse_UPDATE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragAdresse_UPDATE]\r\nON [Verkauf].[tAuftragAdresse]\r\nAFTER UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tUPDATE Verkauf.tAuftragAdresse\r\n\tSET tAuftragAdresse.nZolldokumenteErforderlich = CASE WHEN tland.nEU = 1 THEN 0 ELSE 1 END\r\n\tFROM Verkauf.tAuftragAdresse\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftragAdresse.kAuftrag AND Inserted.nTyp = tAuftragAdresse.nTyp\r\n\tJOIN dbo.tland ON tland.cISO = tAuftragAdresse.cISO;\r\n\r\n\t-- Logging\r\n\tIF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n\tBEGIN\r\n\t\tDECLARE @kBenutzer INT;\r\n\t\tSET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n\t\tINSERT INTO Verkauf.tAuftragAdresse_Log\r\n\t\t(\r\n\t\t\tkBenutzerLog,\r\n\t\t\tdLog,\r\n\t\t\tnActionLog,\r\n\t\t\tkAuftrag,\r\n\t\t\tkKunde,\r\n\t\t\tcFirma,\r\n\t\t\tcAnrede,\r\n\t\t\tcTitel,\r\n\t\t\tcVorname,\r\n\t\t\tcName,\r\n\t\t\tcStrasse,\r\n\t\t\tcPLZ,\r\n\t\t\tcOrt,\r\n\t\t\tcLand,\r\n\t\t\tcTel,\r\n\t\t\tcZusatz,\r\n\t\t\tcAdressZusatz,\r\n\t\t\tcPostID,\r\n\t\t\tcMobil,\r\n\t\t\tcMail,\r\n\t\t\tcFax,\r\n\t\t\tcBundesland,\r\n\t\t\tcISO,\r\n\t\t\tnTyp,\r\n\t\t\tbRowversion,\r\n\t\t\tnZolldokumenteErforderlich\r\n\t\t)\r\n\t\tSELECT\r\n\t\t\t@kBenutzer,\r\n\t\t\tGETDATE(),\r\n\t\t\t1,\r\n\t\t\tDeleted.kAuftrag,\r\n\t\t\tDeleted.kKunde,\r\n\t\t\tDeleted.cFirma,\r\n\t\t\tDeleted.cAnrede,\r\n\t\t\tDeleted.cTitel,\r\n\t\t\tDeleted.cVorname,\r\n\t\t\tDeleted.cName,\r\n\t\t\tDeleted.cStrasse,\r\n\t\t\tDeleted.cPLZ,\r\n\t\t\tDeleted.cOrt,\r\n\t\t\tDeleted.cLand,\r\n\t\t\tDeleted.cTel,\r\n\t\t\tDeleted.cZusatz,\r\n\t\t\tDeleted.cAdressZusatz,\r\n\t\t\tDeleted.cPostID,\r\n\t\t\tDeleted.cMobil,\r\n\t\t\tDeleted.cMail,\r\n\t\t\tDeleted.cFax,\r\n\t\t\tDeleted.cBundesland,\r\n\t\t\tDeleted.cISO,\r\n\t\t\tDeleted.nTyp,\r\n\t\t\tDeleted.bRowversion,\r\n\t\t\tDeleted.nZolldokumenteErforderlich\r\n\t\tFROM Deleted\r\n\t\tJOIN Inserted ON\r\n\t\t\tInserted.kAuftrag = Deleted.kAuftrag AND\r\n\t\t\tInserted.nTyp = Deleted.nTyp\r\n\t\tWHERE\r\n\t\t\tISNULL(Deleted.kKunde, '') <> ISNULL(Inserted.kKunde, '') OR\r\n\t\t\tISNULL(Deleted.cFirma, '') <> ISNULL(Inserted.cFirma, '') OR\r\n\t\t\tISNULL(Deleted.cAnrede, '') <> ISNULL(Inserted.cAnrede, '') OR\r\n\t\t\tISNULL(Deleted.cTitel, '') <> ISNULL(Inserted.cTitel, '') OR\r\n\t\t\tISNULL(Deleted.cVorname, '') <> ISNULL(Inserted.cVorname, '') OR\r\n\t\t\tISNULL(Deleted.cName, '') <> ISNULL(Inserted.cName, '') OR\r\n\t\t\tISNULL(Deleted.cStrasse, '') <> ISNULL(Inserted.cStrasse, '') OR\r\n\t\t\tISNULL(Deleted.cPLZ, '') <> ISNULL(Inserted.cPLZ, '') OR\r\n\t\t\tISNULL(Deleted.cOrt, '') <> ISNULL(Inserted.cOrt, '') OR\r\n\t\t\tISNULL(Deleted.cLand, '') <> ISNULL(Inserted.cLand, '') OR\r\n\t\t\tISNULL(Deleted.cTel, '') <> ISNULL(Inserted.cTel, '') OR\r\n\t\t\tISNULL(Deleted.cZusatz, '') <> ISNULL(Inserted.cZusatz, '') OR\r\n\t\t\tISNULL(Deleted.cAdressZusatz, '') <> ISNULL(Inserted.cAdressZusatz, '') OR\r\n\t\t\tISNULL(Deleted.cPostID, '') <> ISNULL(Inserted.cPostID, '') OR\r\n\t\t\tISNULL(Deleted.cMobil, '') <> ISNULL(Inserted.cMobil, '') OR\r\n\t\t\tISNULL(Deleted.cMail, '') <> ISNULL(Inserted.cMail, '') OR\r\n\t\t\tISNULL(Deleted.cFax, '') <> ISNULL(Inserted.cFax, '') OR\r\n\t\t\tISNULL(Deleted.cBundesland, '') <> ISNULL(Inserted.cBundesland, '') OR\r\n\t\t\tISNULL(Deleted.cISO, '') <> ISNULL(Inserted.cISO, '') OR\r\n\t\t\tISNULL(Deleted.nZolldokumenteErforderlich, '') <> ISNULL(Inserted.nZolldokumenteErforderlich, '');\r\n\tEND\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"triggerName": "tgr_Verkauf_tAuftragPosition_DELETE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragPosition_DELETE]\r\nON [Verkauf].[tAuftragPosition]\r\nAFTER DELETE\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\r\n --Überprüfen ob Trigger gefüllt aufgerufen wird\r\n IF NOT EXISTS(SELECT * FROM Deleted)\r\n BEGIN\r\n RETURN\r\n END\r\n\r\n IF (CONTEXT_INFO() IS NULL\r\n OR CONTEXT_INFO() NOT IN (HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_DELETE')))\r\n BEGIN\r\n DECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n DECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_DELETE');\r\n SET CONTEXT_INFO @hash;\r\n\r\n IF(OBJECT_ID('tempdb..#Auftraege') IS NOT NULL)\r\n BEGIN\r\n DROP TABLE #Auftraege;\r\n END\r\n\r\n CREATE TABLE #Auftraege(kAuftrag INT PRIMARY KEY);\r\n\r\n INSERT INTO #Auftraege (kAuftrag)\r\n SELECT DISTINCT Deleted.kAuftrag\r\n FROM Deleted\r\n\r\n\r\n IF(OBJECT_ID('tempdb..#Positionen') IS NOT NULL)\r\n BEGIN\r\n DROP TABLE #Positionen;\r\n END\r\n\r\n CREATE TABLE #Positionen(kAuftragPosition INT PRIMARY KEY, kAuftrag INT NOT NULL);\r\n\r\n -- Geloeschte Positionen hinzufuegen\r\n INSERT INTO #Positionen (kAuftragPosition, kAuftrag)\r\n SELECT Deleted.kAuftragPosition, Deleted.kAuftrag\r\n FROM Deleted\r\n\r\n IF EXISTS(SELECT * FROM Deleted WHERE Deleted.kAuftragStueckliste != 0 OR Deleted.kKonfigVater != 0)\r\n BEGIN\r\n -- zuerst Konfigurationskomponenten hinzufügen, danach Stücklistenkinder, weil Stückliste in Konfguration erlaubt ist, aber Konfiguration in Stückliste nicht.\r\n\r\n -- 2) Konfi-Kinder der zu loeschenden Positionen hinzufuegen\r\n INSERT INTO #Positionen (kAuftragPosition, kAuftrag)\r\n SELECT tAuftragPosition.kAuftragPosition, tAuftragPosition.kAuftrag\r\n FROM #Positionen\r\n JOIN Verkauf.tAuftragPosition ON tAuftragPosition.kAuftrag = #Positionen.kAuftrag AND tAuftragPosition.kKonfigVater = #Positionen.kAuftragPosition\r\n WHERE tAuftragPosition.kKonfigVater != 0 AND NOT EXISTS (SELECT * FROM #Positionen WHERE #Positionen.kAuftragPosition = tAuftragPosition.kAuftragPosition);\r\n\r\n -- 3) nochmal Stuecklistenkinder fuer zu loeschende Positionen hinzufuegen\r\n INSERT INTO #Positionen (kAuftragPosition, kAuftrag)\r\n SELECT tAuftragPosition.kAuftragPosition, #Positionen.kAuftrag\r\n FROM #Positionen\r\n JOIN Verkauf.tAuftragPosition ON tAuftragPosition.kAuftragStueckliste = #Positionen.kAuftragPosition\r\n WHERE NOT EXISTS (SELECT * FROM #Positionen WHERE #Positionen.kAuftragPosition = tAuftragPosition.kAuftragPosition);\r\n END\r\n\r\n IF EXISTS(SELECT tRechnungPosition.kRechnungPosition\r\n FROM Rechnung.tRechnungPosition\r\n JOIN #Positionen ON #Positionen.kAuftragPosition = tRechnungPosition.kAuftragPosition)\r\n BEGIN\r\n SET CONTEXT_INFO @OldContextInfo;\r\n ROLLBACK;\r\n RAISERROR (N'Die Position steht auf einer Rechnung und kann nicht gelöscht werden.', 18, 1);\r\n RETURN;\r\n END\r\n\r\n IF EXISTS(SELECT tPicklistePos.kPicklistePos\r\n FROM dbo.tPicklistePos\r\n JOIN #Positionen ON #Positionen.kAuftragPosition = tPicklistePos.kBestellPos AND tPicklistePos.nStatus < 40)\r\n BEGIN\r\n SET CONTEXT_INFO @OldContextInfo;\r\n ROLLBACK;\r\n RAISERROR (N'Die Position wird gerade im Versand bearbeitet und kann nicht gelöscht werden.', 18, 1);\r\n RETURN;\r\n END\r\n\r\n DECLARE @retry INT = 5;\r\n WHILE @retry > 0\r\n BEGIN\r\n BEGIN TRY\r\n DECLARE @TranCount INT = @@TRANCOUNT;\r\n IF(@TranCount = 0)\r\n BEGIN\r\n BEGIN TRANSACTION\r\n END\r\n\r\n -- Picklistenpositionen loeschen\r\n --DELETE dbo.tpicklistepos\r\n --FROM dbo.tpicklistepos\r\n --JOIN #Positionen ON #Positionen.kAuftragPosition = tpicklistepos.kBestellPos\r\n\r\n -- Positionen loeschen (an die Temp-Table werden abhaengige Positionen gehaengt, darum wird nicht nur DELETED geloescht\r\n DELETE Verkauf.tAuftragPosition\r\n FROM Verkauf.tAuftragPosition\r\n JOIN #Positionen ON #Positionen.kAuftragPosition = tAuftragPosition.kAuftragPosition\r\n\r\n UPDATE Verkauf.tAuftrag\r\n SET tAuftrag.nAuftragStatus = 255\r\n FROM Verkauf.tAuftrag\r\n JOIN #Auftraege ON #Auftraege.kAuftrag = tAuftrag.kAuftrag\r\n WHERE tAuftrag.nAuftragStatus <> 255\r\n\r\n SET @retry = 0;\r\n IF(@TranCount = 0)\r\n BEGIN\r\n COMMIT TRANSACTION\r\n END\r\n END TRY\r\n BEGIN CATCH\r\n IF(ERROR_NUMBER() = 1205 AND @TranCount = 0 AND XACT_STATE() <> 0)\r\n BEGIN\r\n SET @retry = @retry - 1;\r\n ROLLBACK\r\n END\r\n ELSE\r\n BEGIN\r\n SET @retry = 0;\r\n THROW;\r\n END\r\n END CATCH\r\n END\r\n\r\n SET CONTEXT_INFO @OldContextInfo;\r\n END\r\n\r\n -- AuftragPosition_Log schreiben\r\n IF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n BEGIN\r\n DECLARE @kBenutzer INT;\r\n SET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n INSERT INTO Verkauf.tAuftragPosition_Log (kBenutzerLog,\r\n dLog,\r\n nActionLog,\r\n kAuftragPosition,\r\n kArtikel,\r\n kAuftrag,\r\n cArtNr,\r\n nReserviert,\r\n cName,\r\n cHinweis,\r\n cFNSKU,\r\n fAnzahl,\r\n fEkNetto,\r\n fVkNetto,\r\n fRabatt,\r\n fMwSt,\r\n nSort,\r\n cNameStandard,\r\n kSteuerklasse,\r\n nType,\r\n cEinheit,\r\n nHatUpload,\r\n kKonfigVater,\r\n kKonfigItem,\r\n kAmazonBestellungPos,\r\n kAuftragStueckliste,\r\n kEbayTransaction,\r\n fFaktor,\r\n bRowversion,\r\n kSteuerschluessel,\r\n fWertNettoGesamtFixiert,\r\n fWertBruttoGesamtFixiert)\r\n SELECT\t@kBenutzer,\r\n GETDATE(),\r\n 2,\r\n Deleted.kAuftragPosition,\r\n Deleted.kArtikel,\r\n Deleted.kAuftrag,\r\n Deleted.cArtNr,\r\n Deleted.nReserviert,\r\n Deleted.cName,\r\n Deleted.cHinweis,\r\n Deleted.cFNSKU,\r\n Deleted.fAnzahl,\r\n Deleted.fEkNetto,\r\n Deleted.fVkNetto,\r\n Deleted.fRabatt,\r\n Deleted.fMwSt,\r\n Deleted.nSort,\r\n Deleted.cNameStandard,\r\n Deleted.kSteuerklasse,\r\n Deleted.nType,\r\n Deleted.cEinheit,\r\n Deleted.nHatUpload,\r\n Deleted.kKonfigVater,\r\n Deleted.kKonfigItem,\r\n Deleted.kAmazonBestellungPos,\r\n Deleted.kAuftragStueckliste,\r\n Deleted.kEbayTransaction,\r\n Deleted.fFaktor,\r\n Deleted.bRowversion,\r\n Deleted.kSteuerschluessel,\r\n Deleted.fWertNettoGesamtFixiert,\r\n Deleted.fWertBruttoGesamtFixiert\r\n FROM Deleted;\r\n END\r\n\r\n DECLARE @Artikel AS TYPE_spUpdateLagerbestand;\r\n\r\n INSERT INTO @Artikel (kArtikel)\r\n SELECT Deleted.kArtikel\r\n FROM Deleted\r\n WHERE Deleted.kArtikel > 0\r\n GROUP BY Deleted.kArtikel\r\n\r\n IF (EXISTS(SELECT * FROM @Artikel))\r\n BEGIN\r\n EXEC dbo.spUpdateLagerbestand @Artikel = @Artikel;\r\n END\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"triggerName": "tgr_Verkauf_tAuftragPosition_INSERT",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragPosition_INSERT]\r\nON [Verkauf].[tAuftragPosition]\r\nAFTER INSERT\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n DECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_INSERT');\r\n\tSET CONTEXT_INFO @hash;\r\n\r\n\t-- Auftragstatus updaten\r\n\tUPDATE Verkauf.tAuftrag\r\n\tSET nAuftragStatus = 255\r\n\tFROM Verkauf.tAuftrag\r\n\tJOIN Inserted ON Inserted.kAuftrag = tAuftrag.kAuftrag\r\n\tWHERE tAuftrag.nAuftragStatus <> 255;\r\n\r\n\t-- wenn ntype 1 oder 2 und nreserviert = 0 -> nreserviert = 1\r\n\t-- wenn andere ntype und nreserviert = 1 -> nreserviert = 0\r\n\tUPDATE Verkauf.tAuftragPosition\r\n\tSET nReserviert = CASE WHEN tAuftrag.nType IN (1, 2) THEN 1 ELSE 0 END\r\n\tFROM Verkauf.tAuftragPosition\r\n\tJOIN Verkauf.tAuftrag ON tAuftrag.kAuftrag = tAuftragPosition.kAuftrag\r\n\tJOIN Inserted ON Inserted.kAuftragPosition = tAuftragPosition.kAuftragPosition\r\n\tWHERE tAuftragPosition.nReserviert = CASE WHEN tAuftrag.nType IN (1, 2) THEN 0 ELSE 1 END;\r\n\r\n\t-- Reservierungen fuer Amazon-Bestellungen loeschen\r\n\tDELETE FROM tExterneReservierung\r\n\tFROM dbo.tExterneReservierung\r\n\tJOIN Inserted ON tExterneReservierung.kKey = Inserted.kAmazonBestellungPos AND tExterneReservierung.nTyp = 3;\r\n\r\n\tSET CONTEXT_INFO @OldContextInfo;\r\n\t \r\n\t-- AuftragPosition_Log schreiben\r\n\tIF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n BEGIN\r\n DECLARE @kBenutzer INT;\r\n SET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n INSERT INTO Verkauf.tAuftragPosition_Log (kBenutzerLog,\r\n dLog,\r\n nActionLog,\r\n kAuftragPosition,\r\n kArtikel,\r\n kAuftrag,\r\n cArtNr,\r\n nReserviert,\r\n cName,\r\n cHinweis,\r\n cFNSKU,\r\n fAnzahl,\r\n fEkNetto,\r\n fVkNetto,\r\n fRabatt,\r\n fMwSt,\r\n nSort,\r\n cNameStandard,\r\n kSteuerklasse,\r\n nType,\r\n cEinheit,\r\n nHatUpload,\r\n kKonfigVater,\r\n kKonfigItem,\r\n kAmazonBestellungPos,\r\n kAuftragStueckliste,\r\n kEbayTransaction,\r\n fFaktor,\r\n bRowversion,\r\n kSteuerschluessel,\r\n fWertNettoGesamtFixiert,\r\n fWertBruttoGesamtFixiert)\r\n SELECT\t@kBenutzer,\r\n GETDATE(),\r\n 3,\r\n tAuftragPosition.kAuftragPosition,\r\n tAuftragPosition.kArtikel,\r\n tAuftragPosition.kAuftrag,\r\n tAuftragPosition.cArtNr,\r\n tAuftragPosition.nReserviert,\r\n tAuftragPosition.cName,\r\n tAuftragPosition.cHinweis,\r\n tAuftragPosition.cFNSKU,\r\n tAuftragPosition.fAnzahl,\r\n tAuftragPosition.fEkNetto,\r\n tAuftragPosition.fVkNetto,\r\n tAuftragPosition.fRabatt,\r\n tAuftragPosition.fMwSt,\r\n tAuftragPosition.nSort,\r\n tAuftragPosition.cNameStandard,\r\n tAuftragPosition.kSteuerklasse,\r\n tAuftragPosition.nType,\r\n tAuftragPosition.cEinheit,\r\n tAuftragPosition.nHatUpload,\r\n tAuftragPosition.kKonfigVater,\r\n tAuftragPosition.kKonfigItem,\r\n tAuftragPosition.kAmazonBestellungPos,\r\n tAuftragPosition.kAuftragStueckliste,\r\n tAuftragPosition.kEbayTransaction,\r\n tAuftragPosition.fFaktor,\r\n tAuftragPosition.bRowversion,\r\n tAuftragPosition.kSteuerschluessel,\r\n tAuftragPosition.fWertNettoGesamtFixiert,\r\n tAuftragPosition.fWertBruttoGesamtFixiert\r\n FROM Inserted\r\n JOIN Verkauf.tAuftragPosition \r\n ON tAuftragPosition.kAuftragPosition = Inserted.kAuftragPosition;\r\n\tEND\r\nEND\r\n\r\n"
|
|
},
|
|
{
|
|
"schemaName": "Verkauf",
|
|
"tableName": "tAuftragPosition",
|
|
"triggerName": "tgr_Verkauf_tAuftragPosition_UPDATE",
|
|
"isDisabled": false,
|
|
"quotedIdentOn": true,
|
|
"ansiNullsOn": true,
|
|
"definition": "CREATE TRIGGER [Verkauf].[tgr_Verkauf_tAuftragPosition_UPDATE]\r\nON [Verkauf].[tAuftragPosition]\r\nAFTER UPDATE\r\nAS\r\nSET NOCOUNT ON;\r\nBEGIN\r\n\tIF NOT EXISTS (SELECT * FROM inserted)\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND\r\n\r\n\tIF (CONTEXT_INFO() IN (HASHBYTES('SHA1', 'Verkauf.spAuftragEckdatenBerechnen')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_INSERT')\r\n\t\t\t\t\t\t , HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_DELETE')\r\n\t\t\t\t\t\t ))\r\n\tBEGIN\r\n\t\tRETURN\r\n\tEND\r\n\r\n\t-- nAuftragStatus auf 255 setzen, um zu signalisieren, dass eine erneute Eckdatenberechnung erforderlich ist,\r\n\t-- wenn eine der folgenden Spalten geändert wurden:\r\n\tIF (UPDATE(kArtikel)\r\n\t OR UPDATE(kKonfigVater)\r\n\t OR UPDATE(kKonfigItem)\r\n\t OR UPDATE(kAuftragStueckliste)\r\n\t OR UPDATE(fVkNetto)\r\n\t OR UPDATE(fWertNettoGesamtFixiert)\r\n\t OR UPDATE(fWertBruttoGesamtFixiert)\r\n\t OR UPDATE(fAnzahl)\r\n\t OR UPDATE(fRabatt)\r\n\t OR UPDATE(fFaktor)\r\n\t OR UPDATE(fMwSt)\r\n\t)\r\n\tBEGIN\r\n\t\tDECLARE @OldContextInfo VARBINARY(128) = ISNULL(CONTEXT_INFO(), 0x0);\r\n\t\tDECLARE @hash VARBINARY(128) = HASHBYTES('SHA1', 'tgr_Verkauf_tAuftragPosition_UPDATE');\r\n\t\tSET CONTEXT_INFO @hash;\r\n\r\n\t\t-- Auftrag updaten\r\n\t\tUPDATE Verkauf.tAuftrag\r\n\t\tSET tAuftrag.nAuftragStatus = 255\r\n\t\tFROM Verkauf.tAuftrag\r\n\t\tJOIN\r\n\t\t(\r\n\t\t\tSELECT Inserted.kAuftrag\r\n\t\t\tFROM Inserted\r\n\t\t\tJOIN Deleted ON Deleted.kAuftragPosition = Inserted.kAuftragPosition\r\n\t\t\tWHERE\r\n\t\t\t\tEXISTS\r\n\t\t\t(\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tInserted.kArtikel,\r\n\t\t\t\t\tInserted.kKonfigVater,\r\n\t\t\t\t\tInserted.kKonfigItem,\r\n\t\t\t\t\tInserted.kAuftragStueckliste,\r\n\t\t\t\t\tInserted.fVkNetto,\r\n\t\t\t\t\tInserted.fWertNettoGesamtFixiert,\r\n\t\t\t\t\tInserted.fWertBruttoGesamtFixiert,\r\n\t\t\t\t\tInserted.fAnzahl,\r\n\t\t\t\t\tInserted.fRabatt,\r\n\t\t\t\t\tInserted.fFaktor,\r\n\t\t\t\t\tInserted.fMwSt\r\n\t\t\t\tEXCEPT\r\n\t\t\t\tSELECT\r\n\t\t\t\t\tDeleted.kArtikel,\r\n\t\t\t\t\tDeleted.kKonfigVater,\r\n\t\t\t\t\tDeleted.kKonfigItem,\r\n\t\t\t\t\tDeleted.kAuftragStueckliste,\r\n\t\t\t\t\tDeleted.fVkNetto,\r\n\t\t\t\t\tDeleted.fWertNettoGesamtFixiert,\r\n\t\t\t\t\tDeleted.fWertBruttoGesamtFixiert,\r\n\t\t\t\t\tDeleted.fAnzahl,\r\n\t\t\t\t\tDeleted.fRabatt,\r\n\t\t\t\t\tDeleted.fFaktor,\r\n\t\t\t\t\tDeleted.fMwSt\r\n\t\t\t)\r\n\t\t\tGROUP BY Inserted.kAuftrag\r\n\t\t) AS ModifiedAuftrag ON ModifiedAuftrag.kAuftrag = tAuftrag.kAuftrag\r\n\t\tWHERE tAuftrag.nAuftragStatus <> 255;\r\n\r\n\t\tSET CONTEXT_INFO @OldContextInfo;\r\n\tEND\r\n\r\n\t-- AuftragPosition_Log schreiben\r\n\tIF((SELECT TOP 1 CASE WHEN cValue = '1' THEN 1 ELSE 0 END FROM dbo.tOptions WHERE cKey = 'Auftragshistorie.Aktivieren') = 1)\r\n\tBEGIN\r\n\t\tDECLARE @kBenutzer INT;\r\n\t\tSET @kBenutzer = TRY_CAST(SUBSTRING(APP_NAME(), 0, CHARINDEX(' ', APP_NAME())) AS INT);\r\n\t\tINSERT INTO Verkauf.tAuftragPosition_Log (kBenutzerLog,\r\n\t\t\t\t\t\t\t\t\t\t\t\tdLog,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnActionLog,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkAuftragPosition,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkArtikel,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkAuftrag,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcArtNr,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnReserviert,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcName,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcHinweis,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcFNSKU,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfAnzahl,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfEkNetto,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfVkNetto,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfRabatt,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfMwSt,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnSort,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcNameStandard,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkSteuerklasse,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnType,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcEinheit,\r\n\t\t\t\t\t\t\t\t\t\t\t\tnHatUpload,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkKonfigVater,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkKonfigItem,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkAmazonBestellungPos,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkAuftragStueckliste,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkEbayTransaction,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfFaktor,\r\n\t\t\t\t\t\t\t\t\t\t\t\tbRowversion,\r\n\t\t\t\t\t\t\t\t\t\t\t\tkSteuerschluessel,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfWertNettoGesamtFixiert,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfWertBruttoGesamtFixiert)\r\n\t\t\tSELECT\t@kBenutzer,\r\n\t\t\t\t\tGETDATE(),\r\n\t\t\t\t\t1,\r\n\t\t\t\t\tDeleted.kAuftragPosition,\r\n\t\t\t\t\tDeleted.kArtikel,\r\n\t\t\t\t\tDeleted.kAuftrag,\r\n\t\t\t\t\tDeleted.cArtNr,\r\n\t\t\t\t\tDeleted.nReserviert,\r\n\t\t\t\t\tDeleted.cName,\r\n\t\t\t\t\tDeleted.cHinweis,\r\n\t\t\t\t\tDeleted.cFNSKU,\r\n\t\t\t\t\tDeleted.fAnzahl,\r\n\t\t\t\t\tDeleted.fEkNetto,\r\n\t\t\t\t\tDeleted.fVkNetto,\r\n\t\t\t\t\tDeleted.fRabatt,\r\n\t\t\t\t\tDeleted.fMwSt,\r\n\t\t\t\t\tDeleted.nSort,\r\n\t\t\t\t\tDeleted.cNameStandard,\r\n\t\t\t\t\tDeleted.kSteuerklasse,\r\n\t\t\t\t\tDeleted.nType,\r\n\t\t\t\t\tDeleted.cEinheit,\r\n\t\t\t\t\tDeleted.nHatUpload,\r\n\t\t\t\t\tDeleted.kKonfigVater,\r\n\t\t\t\t\tDeleted.kKonfigItem,\r\n\t\t\t\t\tDeleted.kAmazonBestellungPos,\r\n\t\t\t\t\tDeleted.kAuftragStueckliste,\r\n\t\t\t\t\tDeleted.kEbayTransaction,\r\n\t\t\t\t\tDeleted.fFaktor,\r\n\t\t\t\t\tDeleted.bRowversion,\r\n\t\t\t\t\tDeleted.kSteuerschluessel,\r\n\t\t\t\t\tDeleted.fWertNettoGesamtFixiert,\r\n\t\t\t\t\tDeleted.fWertBruttoGesamtFixiert\r\n\t\t\tFROM Deleted\r\n\t\t\tJOIN Inserted ON Inserted.kAuftragPosition = Deleted.kAuftragPosition\r\n\t\t\tWHERE\r\n\t\t\t\tISNULL(Deleted.kArtikel, '') <> ISNULL(Inserted.kArtikel, '') OR\r\n\t\t\t\tDeleted.kAuftrag <> Inserted.kAuftrag OR\r\n\t\t\t\tISNULL(Deleted.cArtNr, '') <> ISNULL(Inserted.cArtNr, '') OR\r\n\t\t\t\tDeleted.nReserviert <> Inserted.nReserviert OR\r\n\t\t\t\tISNULL(Deleted.cName, '') <> ISNULL(Inserted.cName, '') OR\r\n\t\t\t\tISNULL(Deleted.cHinweis, '') <> ISNULL(Inserted.cHinweis, '') OR\r\n\t\t\t\tISNULL(Deleted.cFNSKU, '') <> ISNULL(Inserted.cFNSKU, '') OR\r\n\t\t\t\tDeleted.fAnzahl <> Inserted.fAnzahl OR\r\n\t\t\t\tDeleted.fEkNetto <> Inserted.fEkNetto OR\r\n\t\t\t\tDeleted.fVkNetto <> Inserted.fVkNetto OR\r\n\t\t\t\tDeleted.fRabatt <> Inserted.fRabatt OR\r\n\t\t\t\tDeleted.fMwSt <> Inserted.fMwSt OR\r\n\t\t\t\tDeleted.nSort <> Inserted.nSort OR\r\n\t\t\t\tISNULL(Deleted.cNameStandard, '') <> ISNULL(Inserted.cNameStandard, '') OR\r\n\t\t\t\tISNULL(Deleted.kSteuerklasse, '') <> ISNULL(Inserted.kSteuerklasse, '') OR\r\n\t\t\t\tDeleted.nType <> Inserted.nType OR\r\n\t\t\t\tISNULL(Deleted.cEinheit, '') <> ISNULL(Inserted.cEinheit, '') OR\r\n\t\t\t\tDeleted.nHatUpload <> Inserted.nHatUpload OR\r\n\t\t\t\tISNULL(Deleted.kKonfigVater, '') <> ISNULL(Inserted.kKonfigVater, '') OR\r\n\t\t\t\tISNULL(Deleted.kKonfigItem, '') <> ISNULL(Inserted.kKonfigItem, '') OR\r\n\t\t\t\tISNULL(Deleted.kAmazonBestellungPos, '') <> ISNULL(Inserted.kAmazonBestellungPos, '') OR\r\n\t\t\t\tISNULL(Deleted.kAuftragStueckliste, '') <> ISNULL(Inserted.kAuftragStueckliste, '') OR\r\n\t\t\t\tISNULL(Deleted.kEbayTransaction, '') <> ISNULL(Inserted.kEbayTransaction, '') OR\r\n\t\t\t\tDeleted.fFaktor <> Inserted.fFaktor OR\r\n\t\t\t\tISNULL(Deleted.kSteuerschluessel, '') <> ISNULL(Inserted.kSteuerschluessel, '') OR\r\n\t\t\t\tDeleted.fWertNettoGesamtFixiert <> Inserted.fWertNettoGesamtFixiert AND (Deleted.fWertNettoGesamtFixiert IS NOT NULL OR Inserted.fWertNettoGesamtFixiert IS NOT NULL) OR\r\n\t\t\t\tDeleted.fWertBruttoGesamtFixiert <> Inserted.fWertBruttoGesamtFixiert AND (Deleted.fWertBruttoGesamtFixiert IS NOT NULL OR Inserted.fWertBruttoGesamtFixiert IS NOT NULL);\r\n\tEND\r\nEND\r\n\r\n"
|
|
}
|
|
]
|
|
}
|