Buongiorno,
qual'è l'istruzione sql per convertire un campo da varchar a nvarchar??
Buongiorno,
qual'è l'istruzione sql per convertire un campo da varchar a nvarchar??
convert(tipo, valore)
Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?
I'm not Jedi. I'm a guy with a lighsaber and a few questions.
mettiamo caso che il mio campo si chiami "testo". Una volta che, tramite pag. ASP ho fatto il collegamento al DB, cosa devo fare? come faccio a richiamare la tabella che mi interessa e dirgli di trasformare il campo "testo" da varchar a nvarchar??
mm la conversione la fai quando inserisci i dati nel DB...
se invece devi proprio modificare il tipo di campo sul db, l'istruzione SQL non la sò... e credo che non ci sia molta gente qui che la sappia, sono cose che non si usano quasi mai...
non sò manco se esista...
cmq prova a cercare su
http://msnd.microsoft.com
se invece il campo è nvchar... bhe quando fai la insert..
"insert into (test) value(convert(nvchar,'"&testo&"'))";
Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?
I'm not Jedi. I'm a guy with a lighsaber and a few questions.
è si, ho bisogno di cambiare il tipo di dati nei DB e non mentre faccio le insert, beh grazie comunque :-)
dal manuale di mysql:
If you want to change a column’s type but not the name, CHANGE syntax still requires
an old and new column name, even if they are the same. For example:
mysql> ALTER TABLE t1 CHANGE b b BIGINT NOT NULL;
However, as of MySQL Version 3.22.16a, you can also use MODIFY to change a column’s
type without renaming it:
mysql> ALTER TABLE t1 MODIFY b BIGINT NOT NULL;