change the datatype of a field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coolminded
    New Member
    • Mar 2007
    • 137

    change the datatype of a field

    hi,
    can i change the datatype of any field from numeric to varchar, or any other type..
    i have a field 'id' which is numeric type,
    but now i have to change it to varchar(20),
    is it possible to do.
    thanx in advance.
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    Try this
    Code:
    alter table q alter column i type varchar(20);
    it works if there are no numbers in i column which has more than 20 digits.

    Comment

    Working...