Thursday, April 22, 2010

SQL Server : ALTER COLUMN – Change the Size of the Column using ALTER Command

We can change the size of the already created column in the table using the ALTER command.

Example:

--Create test table
CREATE TABLE TestAlterCommand
(     EmpNo INT,
      EmpName varchar(10)
);

--Change the size of the column 'EmpName' from 10- 50;
ALTER TABLE TestAlterCommand
 
ALTER COLUMN EmpName varchar(50);

Happy Learning !!!

No comments:

Post a Comment