>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.