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)
 ALTER TABLE MODIFY

Author  Topic 

jamboreeh
Starting Member

2 Posts

Posted - 2006-01-19 : 21:53:14
hi!

i encountered problems when running this code in SQL Query

ALTER TABLE [dbo].[amsSchedule]
MODIFY(CutOff1 datetime NULL,
[FileName] varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)

my aim is to modify the two fields to change its data type. BUt when im trying to run this command in the query analyzer, itsays "incorrect syntax error '(' "

What do i have to do? please help me...thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-19 : 21:55:41
it should be ALTER TABLE table ALTER COLUMN column_name
see Books Online for detail syntax

-----------------
'KH'

Go to Top of Page

jamboreeh
Starting Member

2 Posts

Posted - 2006-01-19 : 22:30:00
hi KH! Thanks for the reply but what i'm trying to do is to modify 2 columns in one alter table statement...

I know if i used the alter column command, i can only alter 1 column at a time...but what im trying to do is to alter 2 columns at the same time...do you know any code where i can alter 2 columns at one alter table statement?

thanks!
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-19 : 22:38:37
I don't think you can do that. Maybe somebody else have a solution.

What do you want to do this ? What's wrong with using 2 alter table command ?

-----------------
'KH'

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-20 : 01:06:14
To see the script, do this in Enterprise Manager and click save change script and see the code

Madhivanan

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

- Advertisement -