SQL Add Column

In SQL Add Column is used to add a new column to the existing table. For this Sql Server alter table add column demonstration, we use the Customer table.

SQL Add Column 1

SQL Add Column example

To add a new column to the existing table, please use the following Alter table Add Column syntax.

-- SQL Server Add Column
ALTER TABLE [Table_Name]
ADD [New_Column] Data_Type (Length) NULL | NOT NULL

Let me add Sales Column that allows Nulls to an existing Customers table

-- SQl Server Add Column Example
USE [NewNameDB]
GO

ALTER TABLE Customers
ADD Sales MONEY NULL
Messages
-------
Commands completed successfully.

In the above Server code, we added Sales Column of Money data type, and it will allow NULL Values. You can see the new column

SQL Add Column 3

Add Column using SSMS

From the Management Studio, right-click on the table, and select the Design to add a new SQL Server column.

SQL Add Column 4

Selecting the Design option will open the table in design mode. Let me a add new column called Tax of Money data type.

SQL Add Column 6

Click the Close button will display the pop-up window. Please select the Yes button to save the changes.

SQL Add Column 7

Now you can see the newly added column called the tax.

SQL Add Column 8