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)
 Changing the Datatype in a column

Author  Topic 

sujosh
Yak Posting Veteran

55 Posts

Posted - 2005-07-14 : 17:59:28
Can we change the datatype in a column? Looking at BOL I came accross "object.AlterDataType( Datatype , [ Length ] , [ Precision ] , [ Scale ] )"

How can I use this in an alter statement?

In Oracle I know we can do this
alter table xyz modify name varchar2(3);

Thanks

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2005-07-14 : 18:46:53
Have a look at ALTER TABLE in Books Online
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-07-14 : 19:03:45
Here's an example:

ALTER TABLE ALTER COLUMN ColumnName varchar(50) NOT NULL

Tara
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-15 : 01:08:17
Small Correction on Tara's code

ALTER TABLE TableName ALTER COLUMN ColumnName varchar(50) NOT NULL



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -