Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change SQL column from numeric(3,0) to numeric(6,0)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01685524
Message ID:
01685529
Vues:
37
>Hi,
>
>I am trying to write a code (in a .prg) that would change a SQL Server column size from numeric(3,0) to numeric(6,0). But I can't.
>Anyone can suggest a code to make such a column size change?
>
>TIA

What is wrong with integer?
As Tore said int is better than numeric(6,0)
Pure TSQL command:
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE Table_NAME = 'YourTableName'
                                                     AND Column_Name = 'ColumnName'
                                                     AND Data_Type = 'int')
   BEGIN
      ALTER TABLE YoutTable ALTER COLUMN YourColumn int
   END
Keep in mind that if you have some constraints with this column you should remove them first and set them back again.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform