myGully.com

myGully.com (https://mygully.com/index.php)
-   Programmierung (https://mygully.com/forumdisplay.php?f=67)
-   -   SQL / MYSQL Hilfe (https://mygully.com/showthread.php?t=2765386)

zartbitter 30.11.12 12:07

SQL / MYSQL Hilfe
 
Hallo Leute,
brauche mal eure Hilfe bei diesen MYSQL Sätzen.

Benutze ALTER TABLES um foreign keys für deine datenbank zu erstllen und execute diese, benutze auch ON UPDATE UND ON DELETE.

ALTER TABLE bla
ADD FOREIGN KEY (bla.id)
REFERENCES bla2(bla.id)
ON UPDATE CASCADE/RESTRICT
ON DELETE CASCADE/RESTRICT

so richtig ?

spartan-b292 30.11.12 12:22

Und deine Frage ist jetzt genau welche?

zartbitter 30.11.12 13:03

ups
 
bin mir nicht ganz sicher was das beste für meine datenbank ist mit CASCADE/RESTRICT
cascade löscht/updated die rows from parent table ?

ProgMaster 30.11.12 16:47

Wo ist die Frage?


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:01 Uhr.

Powered by vBulletin® (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.