Dropping a user-defined datatype  Chapter 7: Adding, Changing, and Deleting Data

Chapter 6: Using and Creating Datatypes

Getting information about datatypes

Use sp_help to display information about the properties of a system datatype or a user-defined datatype. The report indicates the base type from which the datatype was created, whether it allows nulls, the names of any rules and defaults bound to the datatype, and whether it has the IDENTITY property.

The following examples display the information about the money system datatype and the tid user-defined datatype:

sp_help money
Type_name  Storage_type Length Prec  Scale  
---------- ------------ ------ ----- -----
money      money           8 NULL  NULL
Nulls   Default_name  Rule_name   Identity
-----   ------------  ---------   -------- 
    1   NULL          NULL            NULL

(return status = 0)
sp_help tid
Type_name  Storage_type Length Prec  Scale  
---------- ------------ ------ ----- -----
tid        varchar           6 NULL  NULL
Nulls   Default_name  Rule_name   Identity
-----   ------------  ---------   -------- 
    0   NULL          NULL               0

(return status = 0)




Copyright © 2005. Sybase Inc. All rights reserved. Chapter 7: Adding, Changing, and Deleting Data

View this book as PDF