By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,777 Members | 1,311 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,777 IT Pros & Developers. It's quick & easy.

change the datatype of a field

100+
P: 138
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.
May 23 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 700
Try this
Expand|Select|Wrap|Line Numbers
  1. alter table q alter column i type varchar(20);
  2.  
it works if there are no numbers in i column which has more than 20 digits.
May 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.