Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alter table command ignored, Why?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00642194
Message ID:
00657448
Vues:
32
Anoter work-around that I have discovered is to do your original
SELECT * INTO ##tmptable FROM table1
ALTER ##tmptable ADD new_column char(1)

and then
SELECT * INTO ##tmpTableToUse FROM ##tmptable
DROP ##tmptable

In this new table ##tmpTableToUse, the field new_column is available to you! This requires some extra processing on SQL Server's part, but it might save in code maintenance.

KB Article http://support.microsoft.com/default.aspx?scid=kb;EN-US;q295305 points out that the original ALTER statement won't work unless the new field is referenced in a nested stored procedure.

Hope this helps!

>If you have access to the SQL Server 2000 Query Analyzer, you can have it generate the column list for you. Use the Object Browser windows and drill down to your table. Then right-click, choose Script Object To Clipboard As, and then choose INSERT and then you can do the same thing with SELECT.
>
>-Mike
>
>>I am really trying to avoid that, as I have a lot of tables and a lot of fields names to do this with.
>>Thanks,
>>Darren.
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform