Text Resizer Text Resizer
July 30th, 2010
You're browsing: Scriptmatico.Com » MYSQL » Error 1075 MYSQl

Error 1075 MYSQl

Posted on Ago 25 in MYSQLby adminPrintText Resizer Text Resizer

Bien este articulo lo escribi por algo que me paso con un script de msyql que necesitava, he aqui el codigo:

MySQL:
  1. CREATE TABLE T002Salones (
  2.  
  3.   idT005Campus INTEGER UNSIGNED NOT NULL,
  4.  
  5.   idT002Salon INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  6.  
  7.   Descripcion CHAR NULL,
  8.  
  9.   Cupo INTEGER UNSIGNED NULL,
  10.  
  11.   PRIMARY KEY(idT005Campus, idT002Salon)
  12.  
  13. );

Bien al ejecutar este codigo marca un error el cual es el error 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key. Bien este error es causa de que AUTO_INCREMENT se encuentra en una columna secundaria y se estan definiendo dos llaves primarias, la forma de solucionar esto es especificando el tipo de tabla con Type=MyIsam y el codigo quedaria asi:

MySQL:
  1. CREATE TABLE T002Salones (
  2.  
  3.   idT005Campus INTEGER UNSIGNED NOT NULL,
  4.  
  5.   idT002Salon INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  6.  
  7.   Descripcion CHAR NULL,
  8.  
  9.   Cupo INTEGER UNSIGNED NULL,
  10.  
  11.   PRIMARY KEY(idT005Campus, idT002Salon)
  12.  
  13. )Type=MyIsam;

Ahora al momento de ejecutar el script ya no marcara el error, que facil verdad :P , espero le ayude a alguien este articulo.

Post to Twitter


  • No Related Post

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Back to Top
[x] Cerrar
E-mail