Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old May 23rd, 2008, 07:23 AM
Member
 
Join Date: Mar 2007
Posts: 106
Default 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.
Reply
  #2  
Old May 23rd, 2008, 09:22 AM
Moderator
 
Join Date: Dec 2006
Posts: 250
Default

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

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles