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

Author  Topic 

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2008-11-24 : 21:21:43
I am trying to alter a table using SQL Express 2005, but cannot get it to work. This is what I have:

alter table employee_tbl modify
emp_id varchar (10)

I know that modify is not the correct word, but what is? Is there a way to view "keywords" in SQL?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2008-11-24 : 21:45:26
http://msdn.microsoft.com/en-us/library/ms130214.aspx

That's the web link for SQL Server Books Online. I don't know if SQL Express installs a local version of it but the web link has all the information.

The correct syntax is:

ALTER TABLE Employee_tbl ALTER COLUMN emp_id varchar(10)
Go to Top of Page

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2008-11-24 : 22:12:47
Thanks!
quote:
Originally posted by robvolk

http://msdn.microsoft.com/en-us/library/ms130214.aspx

That's the web link for SQL Server Books Online. I don't know if SQL Express installs a local version of it but the web link has all the information.

The correct syntax is:

ALTER TABLE Employee_tbl ALTER COLUMN emp_id varchar(10)


Go to Top of Page
   

- Advertisement -