05 June, 2011

Select trigger,procedure,view,table etc... in MS SQL

1.Trigger:
SELECT name FROM sysobjects WHERE xtype='TR'
2.Procedure:
SELECT Name FROM sysobjects WHERE xtype='P'
3.Table:
SELECT Name FROM sysobjects WHERE xtype='U'
4.View:
SELECT Name FROM sysobjects WHERE xtype='V'
5.Foreign Key:
SELECT Name FROM sysobjects WHERE xtype='F'
6.Primary Key:
SELECT Name FROM sysobjects WHERE xtype='PK'
7.Function:
SELECT Name FROM sysobjects WHERE xtype='FN'

N.B.: see the following..............................................
C: Check constraint
D: Default constraint
F: Foreign Key constraint
L: Log
P: Stored procedure
PK: Primary Key constraint
RF: Replication Filter stored procedure
S: System table
TR: Trigger
U: User table
UQ: Unique constraint
V: View
X: Extended stored procedure

No comments:

Post a Comment