User-defined data type: (
sp_addtype)
- Create a birthday data type that allows nulls.EXEC sp_addtype birthday, datetime, 'NULL'GO-- Create a table using the new data type.CREATE TABLE employee (emp_id char (5), emp_first_name char (30), emp_last_name char (40), EMP_BIRTHDAY BIRTHDAY) Temporary table:
The local temporary table is the table name at the beginning of a well number (#). These tables can only be seen on the connection to create a local temporary table. The global temporary table is the name of those starting with two wells (##). Global temporary table can be seen in all connections. If these tables are not explicitly removed before the connection to the global temporary table is disconnected, then all other tasks stopped to reference them, these tables are removed. When the connection to the global temporary table is created, the new task can no longer reference them. The current statement is completed, the association between tasks and tables is removed; it is usually, as long as the connection disconnection of the global temporary table is created, the global temporary table is removed. Many of the traditional uses of the temporary table can be replaced by variables with Table data types. SysObjects accounted for each object (constraint, default, log, rule, storage procedure, etc.) created within the database. Only in the TEMPDB, each temporary object takes a line in the table.
Column Name Data Type Description NamesysName object name. IDint object identification number. XtypeChar (2) Object Type. It can be one of the following object types: c = check constraint D = default or default constraint f = foreign key constraint L = log Fn = scalar function if = embedded table function P = stored procedure pk = primary key constraint (Type Yes K) RF = Copy Filter Store S = System Table TF = Table Function Tr = Trigger U = UF = UNIQUE Constraint (Type K) V = View X = User ID of the stored procedure UIDSMallint owner object. Infosmallint is reserved. Internal use only. Statusint is reserved. Internal use only. Base_schema_verint is retained. Internal use only. Replinfoint reserves. For copying. The object identification number of the Parent_objint (for example, for the trigger or constraint, the identification number is a table ID). CRDATETETIME object creation date. FtcatidSmallint is a full-text catalog identifier for all user tables registered with a full-text index, and is 0 for all user tables that are not registered. The SCHEMA_VERINT version number, which increases when the architecture changes each table. Stats_schema_verint is reserved. Internal use only. TypeChar (2) Object Type. Can be one of the following values: c = CHECK constraint D = default or default constraint f = foreign key constraint FN = scalar function if = embedded table function k = primary key or unique constraint L = log P = stored procedure R = rule RF = Copy Filter Store S = System Table TF = Table Function Tr = Trigger U = User Table V = View X = Extended Store UserStatsmallint Reserved. Sysstatsmallint internal status information. Indexdelsmallint is reserved. RefdatedateTime is reserved for later use. Versionint is reserved for later use. Deltrigint reserved. INSTRIGINT is reserved. Updtrigint is reserved. Seltrigint reserved. Categoryint is used to publish, constraints, and identifies. Cachesmallint is reserved. Can be applied to view users with tables, triggers, views, etc. Such as:
Select * from sysobjects where xtype limited 'u%'