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 2005 Forums
 Transact-SQL (2005)
 "Alter table" and modify field datatype.

Author  Topic 

rum23
Yak Posting Veteran

77 Posts

Posted - 2009-01-21 : 09:42:54

I'm using the following sql to modify the datatype of the field "StartFY" in the table "tblCIP". However I get an error, when executing the sql below. The error is "Incorrect syntax near 'MODIFY'." What is wrong? Please help. Thanks much.

ALTER TABLE dbo.tblCIP MODIFY StartFY datetime NULL

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-21 : 09:44:34
it should be
ALTER TABLE ALTER COLUMN StartFY datetime NULL
Go to Top of Page

karthik_padbanaban
Constraint Violating Yak Guru

263 Posts

Posted - 2009-01-21 : 09:48:32
ALTER TABLE tblCIP ALTER COLUMN StartFY datetime NULL

Karthik
Go to Top of Page

rum23
Yak Posting Veteran

77 Posts

Posted - 2009-01-21 : 09:51:58

perfect, thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-21 : 11:13:40
cheers
Go to Top of Page
   

- Advertisement -