Quantcast
Channel: How to add a column with a default value to an existing table in SQL Server? - Stack Overflow
Viewing all articles
Browse latest Browse all 91

Answer by Gabriel L. for Add a column with a default value to an existing table in SQL Server

$
0
0

If you want to add multiple columns you can do it this way for example:

ALTER TABLE YourTable
    ADD Column1 INT NOT NULL DEFAULT 0,
        Column2 INT NOT NULL DEFAULT 1,
        Column3 VARCHAR(50) DEFAULT 'Hello'
GO

Viewing all articles
Browse latest Browse all 91

Trending Articles