TSQL - Alter Table Add Multiple Columns SQL Server

Sometime we have to add multiple columns to the already existing table.  Instead of adding one column at a time we can add multiple columns in one statement.

Here is example how to Add Multiple Columns to already existing table.

USE TEST1
GO

--Create Table
CREATE TABLE dbo.MyTestTable( ID INT)
--Add Multiple columns in one statement
ALTER TABLE dbo.MYTestTable
ADD
Name VARCHAR(100) NOT NULL,
ADDRESS VARCHAR(100) NOT NULL,
AGE INT NOT NULL,
PhoneNumber VARCHAR(12)


Video Demo
How to Add Multiple Columns to SQL Server Table in Single SQL Statement

12 comments:

  1. Footstools couple up as square tables and are exceptionally well known with sectionals.ELECTROLUX APPLIANCE REPAIR & SERVICE IN SANTA BARBARA

    ReplyDelete
  2. Even in the wake of investing in a ton of energy, clients in some cases moan in disappointment when the conveyance man at last contacts them with furniture in the wake of hanging tight for quite a long time. Daniel

    ReplyDelete
  3. You can likewise do a hunt on Bing and dive more deeply into what home embellishment is or watch a YouTube video which is truly useful. You can likewise do a hunt on Bing and dive more deeply into what home embellishment is or watch a YouTube video which is truly useful. sherman oaks luxury homes

    ReplyDelete
  4. These services will schedule the delivery and pickup; all you have to do is fill them up within the scheduled time. Alexander Removals

    ReplyDelete
  5. Most fabric protectors are quite advanced, in that they can protect the fabrics from pet body fluids and odors and also from baby spills. Ultra Guard

    ReplyDelete