Tuesday, April 10, 2012

Retrieve Any User Defined Object Details in Sql Server 2008

Retreive all User Defined Object Details

select * from sys.objects where type ='U'
select * from sys.objects where type ='FN'
select * from sys.objects where type ='V'
select * from sys.objects where type ='P'
select * from sys.objects where type ='TR'
select * from sys.objects where type ='PK'

Where Type are Given Below

Object type:
AF = Aggregate function (CLR)
C = CHECK constraint
D = DEFAULT (constraint or stand-alone)
F = FOREIGN KEY constraint
PK = PRIMARY KEY constraint
P = SQL stored procedure
PC = Assembly (CLR) stored procedure
FN = SQL scalar function
FS = Assembly (CLR) scalar function
FT = Assembly (CLR) table-valued function
R = Rule (old-style, stand-alone)
RF = Replication-filter-procedure
S = System base table
SN = Synonym
SQ = Service queue
TA = Assembly (CLR) DML trigger
TR = SQL DML trigger
IF = SQL inline table-valued function
TF = SQL table-valued-function
U = Table (user-defined)
UQ = UNIQUE constraint
V = View
X = Extended stored procedure
IT = Internal table

No comments:

Post a Comment