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
 General SQL Server Forums
 New to SQL Server Programming
 Alter Table - Do I need to refresh something?

Author  Topic 

dlmagers10
Starting Member

48 Posts

Posted - 2010-10-27 : 11:42:54
Ok, I would like to ask you this if I may,

On another database I created a table named FICTION

and the table looks like this:

CREATE TABLE FICTION
(BOOK_CODE CHAR(4) PRIMARY KEY,
TITLE CHAR(40),
PUBLISHER_CODE CHAR(3),
PRICE DECIMAL(4,2) );

Now I am trying to change the data type in TITLE to CHAR(50)

ALTER TABLE FICTION
MODIFY COLUMN TITLE CHAR(50);

Getting an ERROR again. DO I NEED TO REFRESH SOMETHING?

ERROR:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'COLUMN'.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-27 : 11:46:30
create table test(title char(40))
go
alter table test
alter column title char(50)
go
sp_help test



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-10-27 : 11:46:59
Please don't double post:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=152181

There's no MODIFY keyword for changing tables, it's ALTER. Please see above link, this has already been answered.
Go to Top of Page
   

- Advertisement -