If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
"...ADD COLUMN...DEFAULT YES" leaves existing rows as FALSE?
Hi all,
I'm adding a new column via this statement: ALTER TABLE myTable ADD COLUMN myColumn YESNO DEFAULT YES And it works great except that existing rows have myColumn = FALSE even though the default is TRUE (new rows behave correctly). I would expect that existing rows would take on the default? Am I incorrect in my expectation or is there something wrong in my SQL statement? P.S.: If you were about to answer: Just use this statement: UPDATE myTable SET myColumn = YES save your breath I already have done that. The question above still stands though. |
#2
|
|||
|
|||
The Default Value applies only to new records.
It never has an effect on existing records. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Santiago" replytonewsgroup wrote in message ... Hi all, I'm adding a new column via this statement: ALTER TABLE myTable ADD COLUMN myColumn YESNO DEFAULT YES And it works great except that existing rows have myColumn = FALSE even though the default is TRUE (new rows behave correctly). I would expect that existing rows would take on the default? Am I incorrect in my expectation or is there something wrong in my SQL statement? P.S.: If you were about to answer: Just use this statement: UPDATE myTable SET myColumn = YES save your breath I already have done that. The question above still stands though. |
#3
|
|||
|
|||
Thanks Allen for taking the time to respond.
- Santiago -- Santiago Palacios Metalogic Software www.metalogicsw.com "Allen Browne" wrote in message ... The Default Value applies only to new records. It never has an effect on existing records. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Santiago" replytonewsgroup wrote in message ... Hi all, I'm adding a new column via this statement: ALTER TABLE myTable ADD COLUMN myColumn YESNO DEFAULT YES And it works great except that existing rows have myColumn = FALSE even though the default is TRUE (new rows behave correctly). I would expect that existing rows would take on the default? Am I incorrect in my expectation or is there something wrong in my SQL statement? P.S.: If you were about to answer: Just use this statement: UPDATE myTable SET myColumn = YES save your breath I already have done that. The question above still stands though. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
updating a column in existing excel sheet | disgustipated | Worksheet Functions | 0 | June 29th, 2005 08:44 PM |
Lookup Table Dilemma | Karen | Worksheet Functions | 2 | June 10th, 2005 08:22 PM |
generate multiple rows based on cell value | Theresa | Worksheet Functions | 0 | May 25th, 2005 11:18 PM |
Deleting rows contains certain text in column A | plumstone | General Discussion | 1 | September 17th, 2004 08:05 PM |
Deleting rows with no data using Auto Filter and Helper column | John | Worksheet Functions | 1 | April 19th, 2004 06:52 AM |