Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update the Column's lenght

Author  Topic 

M2
Starting Member

22 Posts

Posted - 2003-07-04 : 03:30:50
How to update the Column's lenght from varchar(50) to varchar(60) under SQL Query Analyzer?

I try to update the Information_Schema

Update Information_Schema.Columns
Set CHARACTER_MAXIMUM_LENGTH = '60'
Where Table_Name = 'TableA' and COLUMN_NAME = 'Name'

However, it's fail.

Could any one please guide?

Thanks !

M2

mr_mist
Grunnio

1870 Posts

Posted - 2003-07-04 : 03:41:44
No No No No No No No

You don't need to play about with the schema like that. There is a statement provided to alter tables. It's

ALTER TABLE yourtable ALTER COLUMN yourcolumn newdatatype

So

ALTER TABLE tablea ALTER COLUMN [name] varchar(60) null

-------
Moo.
Go to Top of Page

M2
Starting Member

22 Posts

Posted - 2003-07-04 : 03:55:30
Thank You Very much !!!

M2

Go to Top of Page
   

- Advertisement -