Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change SQL column from numeric(3,0) to numeric(6,0)
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01685524
Message ID:
01685529
Views:
36
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform