Hi,
This article gives an overall view of the sysobjects table – its commonly used fields – and querying the table for retrieving schema-related information.
Since SQLServer is an RDBMS, the information regarding its objects (database tales, views ..etc,) is also stored in the form of data which can be easily retrieved using a query.
SQLServer stores this object specific information in sysobjects table.
The commonly referred fields are:
- name
- id
- xtype
- uid
- crdate
- schema_ver
Lets go through each Field.
1. name : Stores the database object name like 'tblTest','PK_EMPID' etc.,
2. id :Stores an integer-value representing database object ID.
3. xtype : Stores a character-code representing the Object-Type of the respective object.
The list of objects represented by xtype field are:
- Tables
- Views
- Triggers
- Rules
- Log
- Constraints
- Functions
- Stored-Procedures
The specified objects with their respective Character-Codes and descriptions are given below:
------------------------------------------------------------ Code Object-Type Description ------------------------------------------------------------ S Table System table
U Table User table
V View View
TR Trigger Trigger
L Log Log
C Constraint CHECK constraint
D Constraint Default or DEFAULT constraint
UQ Constraint UNIQUE Constraint
PK Constraint PRIMARY KEY
F Constraint FOREIGN KEY constraint
FN Function Scalar function
TF Function Table function
IF Function Inlined table-function
P Procedure Stored procedure
X Procedure Extended stored procedure
RF Procedure Replication filter stored procedure
------------------------------------------------------------
4. uid : Stores an Integer-Value representing the database object-owner UserID (Referes [UID] from the [sysusers] system-table)
5. crdate : Stores date and time representing the database object creation date.
6. schema_ver : Stores an Integer-Values which keeps on incrementing by 1 when the user alters the respective object.
|
| Author: Danasegarane.A 15 Oct 2008 | Member Level: Diamond Points : 0 |
Nice Resource
Thanks for the Resource
|