Inserting NULLs into columns that do not allow them  Changing a column’s value to NULL

Chapter 7: Adding, Changing, and Deleting Data

Adding rows without values in all columns

When you specify values for only some of the columns in a row, one of four things can happen to the columns with no values:

Table 7-4 shows what you would see under these circumstances:

Table 7-4: Columns with no values

Default exists for column or datatype

Column defined NOT NULL

Column defined to allow NULL

Column is IDENTITY

Yes

The default

The default

Next sequential value

No

Error message

NULL

Next sequential value

You can use sp_help to display a report on a specified table or default or on any other object listed in the system table sysobjects. To see the definition of a default, use sp_helptext.





Copyright © 2005. Sybase Inc. All rights reserved. Changing a column’s value to NULL

View this book as PDF