MySQL Forums
Forum List  »  Italian

Chiedo aiuto - Add column if not exists c#
Posted by: nessuna nessuna
Date: February 21, 2011 02:28AM

Ciao a tutti, scusate ma sto impazzendo, forse per niente, per
scrivere un'istruzione SQL che aggiunga una colonna ad una tabella se la colonna non esiste già.
ho scritto una funzione che esegue i comandi SQL e ho passato questa stringa :

U.EseguiComandoSQL("IF NOT EXISTS (SELECT * FROM GETROTO.COLUMNS WHERE TABLE_NAME = 'aperture' AND COLUMN_NAME = 'PuntoDiRiferimento') BEGIN ALTER TABLE aperture ADD PuntoDiRiferimento DATETIME END");

Non mi va.
Dov'è l'errore?? Oppure come si fa? Grazie
Ciao
Filippo

Options: ReplyQuote


Subject
Views
Written By
Posted
Chiedo aiuto - Add column if not exists c#
3543
February 21, 2011 02:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.