SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ALTER TABLE MODIFY
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jamboreeh
Starting Member

2 Posts

Posted - 01/19/2006 :  21:53:14  Show Profile  Reply with Quote
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)

Singapore
17681 Posts

Posted - 01/19/2006 :  21:55:41  Show Profile  Reply with Quote
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 - 01/19/2006 :  22:30:00  Show Profile  Reply with Quote
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)

Singapore
17681 Posts

Posted - 01/19/2006 :  22:38:37  Show Profile  Reply with Quote
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

India
22769 Posts

Posted - 01/20/2006 :  01:06:14  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000