Scusami sono stato intrippato con mille cose.
Grazie mille, è ok funziona, così mi creo un recordset con le stringhe di 'alter table...'
Ho modificato lo script in modo da escludere le chiavi sennò mmi avrebbe generato errore, è diventato così:
Ora ancora più difficile:codice:select 'alter table miatabella alter column ' + column_name + ' ' + data_type + case data_type when 'datetime' then '' when 'float' then '' when 'int' then '' when 'money' then '' when 'smallint' then '' when 'timestamp' then '' when 'varchar' then '(' + convert(varchar,(CHARACTER_MAXIMUM_LENGTH)) + ' ) ' end + ' NULL' from information_schema.columns where table_name='miatabella' and column_name not in (select column_name from information_schema.KEY_COLUMN_USAGE where table_name='miatabella')
c'è modo di dire a sql di ciclare su questi record e di eseguire le stringhe che vi trova dentro?