Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/07/2012, 12:24
andrwyo2006
 
Fecha de Ingreso: junio-2012
Mensajes: 77
Antigüedad: 11 años, 10 meses
Puntos: 5
Respuesta: Error Clave Foranea

pues parece q no...
Código SQL:
Ver original
  1. ALTER TABLE `empleado`ADD CONSTRAINT `FK_idArea`
  2. FOREIGN KEY `FK_idArea` (`idArea`)
  3. REFERENCES `area` (`idArea`)
  4. ON UPDATE CASCADE
  5. ON DELETE SET NULL;
  6. /* SQL Error (1005): Can't create table 'touche.#sql-340_1' (errno: 150)
  7.  
  8. Foreign key constraint is incorrectly formed */
  9. /* 0 rows affected, 0 rows found. Duration for 0 of 1 query: 0,000 sec. */

Código SQL:
Ver original
  1. ALTER TABLE `touche`.`empleado`ADD CONSTRAINT `FK_idArea`
  2. FOREIGN KEY `FK_idArea` (`idArea`)
  3. REFERENCES `touche`.`area` (`idArea`)
  4. ON UPDATE CASCADE
  5. ON DELETE SET NULL;
  6. /* SQL Error (1005): Can't create table 'touche.#sql-340_1' (errno: 150)
  7.  
  8. Foreign key constraint is incorrectly formed */
  9. /* 0 rows affected, 0 rows found. Duration for 0 of 1 query: 0,000 sec. */