private99
asked on
Change field length or type in a database
If I has a table with a field
1) length = 10
2) type = int
the table contains some data.
Now, I decide to change the field
1) length = 20
2) type = varchar
Can I change the field length/type without lossing my data inside the table ?
Assume I use Oracle or MsSQL databse.
1) length = 10
2) type = int
the table contains some data.
Now, I decide to change the field
1) length = 20
2) type = varchar
Can I change the field length/type without lossing my data inside the table ?
Assume I use Oracle or MsSQL databse.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for oracle
alter table <tablename> modify <coloumn name> varchar2(20);
alter table <tablename> modify <coloumn name> varchar2(20);
You should be ok since you are increasing the size of a field and converting a number to a string. You would probably have more problems if you were decreasing the size of a field or converting a string to a number.
Brett