Altering tables using SQL statements
Posted on 2006-07-13
We have a web based product written in php utilizing a MS SQL database. We have clients that host our software internally meaning when we have to send them updates to our software we are not able see their version of the database, meaning if one of our updates includes a database change we have to send them an update script as well that will do this.
That's all be fine up to now, however a bug has been discovered where the Precision of a numeric field was incorrect and so we have written an SQL statment that will change the precision of the field:
ALTER TABLE tablename ALTER COLUMN field_name DOUBLE PRECISION(5);
However we get an error:
The object 'DF__actionpla__statu__07020F21' is dependent on column 'status_percentage_complete'
We obviously need to remove this dependancy before executing the first statement, but we can't work out how to do this using an SQL statement.
Help much apreciated, and time is of the escence so maximum points available.