Specifying length, precision, and scale  Associating rules and defaults with user-defined datatypes

Chapter 6: Using and Creating Datatypes

Specifying null type

The null type determines how the user-defined datatype treats nulls. You can create a user-defined datatype with a null type of “null”, NULL, “nonull”, NONULL, “not null”, or “NOT NULL”. bit and identity types do not allow null values.

If you omit the null type, Adaptive Server uses the null mode defined for the database (by default, NOT NULL). For compatibility with SQL standards, use sp_dboption to set the allow nulls by default option to true.

You can override the null type when you include the user-defined datatype in a create table statement.





Copyright © 2005. Sybase Inc. All rights reserved. Associating rules and defaults with user-defined datatypes

View this book as PDF