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 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.
Add Column using SSMS
From the Management Studio, right-click on the table, and select the Design to add a new SQL Server column.
Selecting the Design option will open the table in design mode. Let me a add new column called Tax of Money data type.
Click the Close button will display the pop-up window. Please select the Yes button to save the changes.
Now you can see the newly added column called the tax.