Table TblOfTbl

Description of table TblOfTbl

Rather than having several lookup or ancilliary tables to store valid values for a given data element, we are utilizing a table of tables scheme. This table contains a short name for a lookup table and a brief description. The related detail data for the lookup values used by each of those tables is stored in the master codes (MstrCd) table.


Code preview of table TblOfTbl

use StudentCentered
go

if exists (select 1
from sysindexes
where id = object_id('dbo.TblOfTbl')
and name = 'EndDt_IDX'
and indid > 0
and indid < 255)
drop index dbo.TblOfTbl.EndDt_IDX
go

if exists (select 1
from sysindexes
where id = object_id('dbo.TblOfTbl')
and name = 'Nm_IDX'
and indid > 0
and indid < 255)
drop index dbo.TblOfTbl.Nm_IDX
go

if exists (select 1
from sysobjects
where id = object_id('dbo.TblOfTbl')
and type = 'U')
drop table dbo.TblOfTbl
go

/*==============================================================*/
/* Table: TblOfTbl */
/*==============================================================*/
create table dbo.TblOfTbl (
ID int not null,
Nm varchar(100) not null,
Descr varchar(255) not null,
CrtrID varchar(18) not null default suser_sname(),
CrtDt datetime not null default getdate(),
UpdtID varchar(18) not null default suser_sname(),
UpdtDt datetime not null default getdate(),
EndDt datetime null,
constraint TblOfTbl_PK primary key nonclustered (ID)
on SmallIDX
)
on SmallTBL
go

/*==============================================================*/
/* Index: Nm_IDX */
/*==============================================================*/
create index Nm_IDX on dbo.TblOfTbl (
Nm
)
on SmallIDX
go

/*==============================================================*/
/* Index: EndDt_IDX */
/*==============================================================*/
create index EndDt_IDX on dbo.TblOfTbl (
EndDt
)
on SmallIDX
go


List of columns of the table TblOfTbl

Name

Code

Table Of Table Identifier

ID

Name

Nm

Description

Descr

Creator Identifier

CrtrID

Create Date

CrtDt

Update Identifier

UpdtID

Update Date

UpdtDt

End Date

EndDt


Column ID of the table TblOfTbl

Card of the column ID of the table TblOfTbl

Name

Table Of Table Identifier

Code

ID

Data Type

int

Mandatory

TRUE


Description of the column ID of the table TblOfTbl

Unique ID assigned and maintained by the database for the TblOfTbl table.


Column Nm of the table TblOfTbl

Card of the column Nm of the table TblOfTbl

Name

Name

Code

Nm

Data Type

varchar(100)

Mandatory

TRUE


Description of the column Nm of the table TblOfTbl

Name of the virtual table.


Column Descr of the table TblOfTbl

Card of the column Descr of the table TblOfTbl

Name

Description

Code

Descr

Data Type

varchar(255)

Mandatory

TRUE


Description of the column Descr of the table TblOfTbl

Description for the virtual table.


Column CrtrID of the table TblOfTbl

Card of the column CrtrID of the table TblOfTbl

Name

Creator Identifier

Code

CrtrID

Data Type

varchar(18)

Mandatory

TRUE


Description of the column CrtrID of the table TblOfTbl

The user identification of the person or process that created the record.


Column CrtDt of the table TblOfTbl

Card of the column CrtDt of the table TblOfTbl

Name

Create Date

Code

CrtDt

Data Type

datetime

Mandatory

TRUE


Description of the column CrtDt of the table TblOfTbl

The date the source row of data was created.


Column UpdtID of the table TblOfTbl

Card of the column UpdtID of the table TblOfTbl

Name

Update Identifier

Code

UpdtID

Data Type

varchar(18)

Mandatory

TRUE


Description of the column UpdtID of the table TblOfTbl

The user identification of the person or process that last updated the record.


Column UpdtDt of the table TblOfTbl

Card of the column UpdtDt of the table TblOfTbl

Name

Update Date

Code

UpdtDt

Data Type

datetime

Mandatory

TRUE


Description of the column UpdtDt of the table TblOfTbl

The date of the last update.


Column EndDt of the table TblOfTbl

Card of the column EndDt of the table TblOfTbl

Name

End Date

Code

EndDt

Data Type

datetime

Mandatory

FALSE


Description of the column EndDt of the table TblOfTbl

The date that this row of data ceases to be effective.