How to alter the table column in SQL Server?
Introduction:
In this article i will explain how to alter table column data type in SQL Server.
Description:
In previous article i explained How to create a table in SQL Server. Now i will explain how to alter table column data type in SQL Server.
Basic Syntax:
alter table <table-name>
alter column <column-name> <new-data-type>
Now we will update EmpName data type from varchar(20) to varchar(500).
alter table Employee
alter column EmpName varchar(500)
-
CreatedSep 05, 2013
-
UpdatedOct 03, 2020
-
Views1,721
Related Articles
Different types of variables in SQL Server
What is Cross Join in SQL Server
How delete record from parent table when there is Foreign Key relation in SQL Server
What is the differences between CHAR, NCHAR, VARCHAR and NVARCHAR in SQL Server?
How to add or remove a column from a table in SQL Server?
How to insert values into Identity Column in SQL Server?
How to get a fixed-length value in SQL Server?
What is Left Join (or) Left Outer Join in SQL Server?
How to get current week dates in SQL Server?
What are the different types of Date formats in SQL Server?