Fill in the column for each row in the database

I just added a new column to the table that contains more than 1000 rows of data. I am wondering how I can update a new column with a piece of data for all rows in the database without having to do it manually.

What is the easiest way to do this?

I work with MS SQL 2005 server. Thank you in advance for your advice.

+5
source share
2 answers

Try it.

UPDATE table_name SET column_name = value

It is indicated that the value you want to assign is a constant. It is right?

+8
source
UPDATE  mytable
SET     newcolumn = 'newvalue'
+5
source

All Articles