Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, How can i modify the datatyp

Status
Not open for further replies.

sssdexter

Programmer
Oct 7, 2003
29
0
0
MY
Hi,

How can i modify the datatype? For example i like to change student_id from varchar(4) to varchar(8)?

Thanks a lot
 
Hi,
This is how you do..
alter table tablename
alter column student_id varchar(8)


But you cannot set it to lesser length than already present.
 
FYI, you can actually set the length to less than any existing data by using SET ANSI_WARNINGS OFF for the connection.

Obviously this will cut off the end of any data that is longer than the new length, so you probably don't want to do this.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top