On Sun, 2004-08-29 at 23:26, Tim Bunce wrote:
> Do any databases support CREATE TABLE statement with fields
> having a DEFAULT clause without a NOT NULL?
>
> CREATE TABLE foo (
> bar INTEGER,
> baz INTEGER DEFAULT 42
> )
>
> and if so, under what circumstances is the default applied?
Sybase works as you would expect ("not null" is the default on my
server):
[25] troll.testdb: 1> create table null_test(a varchar(10), b datetime
default getdate() null);
[26] troll.testdb: 1> insert null_test(a) values("one");
(1 row affected)
[27] troll.testdb: 1> insert null_test(a,b ) values("two",null);
(1 row affected)
[28] troll.testdb: 1> select * from null_test;
a b
---------- -------------------
one Aug 29 2004 11:24PM
two NULL
Michael
--
Michael Peppler Data Migrations, Inc.
[EMAIL PROTECTED] http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions - http://www.peppler.org/resume.html