Wednesday, March 25, 2009

Find objects in database

To find perticular object in database:

SELECT name, owner= user_name(uid) FROM [dbname].dbo.sysobjects WHERE type= 'U' order by name 

Type:

C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FN = Scalar function
IF = Inlined table-function
K = PRIMARY KEY or UNIQUE constraint
L = Log
P = Stored procedure
R = Rule
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
V = View
X = Extended stored procedure

No comments:

Post a Comment