|
-
April 21st, 2009, 02:28 AM
#1
Different alter table behaviour on different DBMS's
Hi!
For test purposes I have a table called 'testtable' with one column 'c1' which is an integer and the primary key of the table.
Then I want to add a new integer column to the table with a default value of 0.
On SQLServer 2005 this is my sql statement:
alter table testtable add c2 int default 0;
This results in a new column where all rows get the value NULL.
When I do the same thing on MySQL or Oracle all rows get the value 0.
Can anyone explain this difference (I know that I could set the "NOT NULL" constraint on the column)
Cheers,
Laitinen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|