Search code examples
sql-serversql-server-2005

Fill a Column for Every Row in a Database


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

What is the easiest way to accomplish this?

I am working with a MS SQL 2005 server. Thank you in advance for your advice.


Solution

  • Try this out.

    UPDATE table_name SET column_name = value
    

    This is given that the value you want to assign is a constant. Is that correct?