I am new to Sql, so I think this is a really easy question.
But I am working on a 2005 MSSQL database.
When I add columns to an existing application with data and tables already being used, and the new column will be set to Database Null.
What is an easy way to quickly add the data to all the rows in the table.
For example if I am adding a checkbox, I've been doing it manually, add the column, change all the rows to False, one by one.
And then I can change it to Disallow DBNull.
As I get more and more users this could be a very time consuming process.
So the name of the Table is classifeds_Ads and let's say the column I want to add is Bonus and it needs to be filled with False.
How do I do this?
Thank you in advance
Daniel Meis
You can create a new query and then just run this:
UPDATE classifieds_Ads Set Bonus = 0
Or an easier approach is to use the Column Properties pane to set the initial properties for the column - Allow Nulls: No, Default Value or Binding: 0
|||
Works great, Thank you.
No comments:
Post a Comment