Bonjour,
peut on verifier l'existance d'un index avant de le creer.
tout cela doit etre mis dans une commande ou on placera dans un fichier toto.sql
j'ai essayé cette commande mais ca marche pas
if not exists (select * from sysindexes where id=object_id('NE_LOG_TABLE') and name='toto') create index toto on NE_LOG_TABLE(logical_name);
je recois l'erreur suivante
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if not exists (select * from sysindexes where id=object_id('NE_LOG_TABLE') and n' at line 1
il est à preciser que je travaille sur musql 4.0
Merci de vos reponses
Partager