Salut,
j'arrive pas à trouver l'erreur dans ce script, pourtant il marche sous MS SQL SERVER 2008.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
    IF EXISTS (
        SELECT * FROM information_schema.COLUMNS
        WHERE column_name='fieldName'
        and table_name='tableName'
        and table_schema='dbName'
        )
    THEN
        ALTER TABLE tableName
                CHANGE fieldName nouevaufieldName INT NOT NULL AUTO_INCREMENT
    END IF;
l'erreur Mysql est:
#1064 - 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 EXISTS ( SELECT * FROM information_schema.COLUMNS WHERE column_name='id' at line 1
est ma version Mysql 5.5.8

Merci pour votre aide