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

9 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
  6. If you’re looking for a stove that can handle a lot of heat, the Blaze King is the perfect option. It can heat up quickly and efficiently, making it perfect for larger rooms or spaces. Plus, its durable construction will make it last long. Blaze King

    ReplyDelete
  7. As an avid gym-goer, acetyl l carnitine has become an essential part of my training preparation. It has helped my energy levels and fat burning during exercises tremendously. The cognitive advantages are a nice additional bonus. If you want to get the most out of your exercises, you should definitely check it out.

    ReplyDelete