Monday, November 30, 2009

Find any Objects you have created in MS-SQL Server

Hi All,

before couple of hours i was looking for one of my user defined function, the misery is i forget its name( ... lazy developer habit), here is solution to my laziness.

SELECT name, id, xtype, uid, info, status, base_schema_ver, replinfo, parent_obj, crdate, ftcatid, schema_ver, stats_schema_ver, type, userstat, sysstat, indexdel, refdate,version, deltrig, instrig, updtrig, seltrig, category, cache
FROM sys.sysobjects

XTYPE =
‘U’ For table
‘PK’ For Primary Keys
‘F’ For Foreight Keys
‘V’ For views
‘P’ For stored procedures
‘TR’ For triggers
‘S’ For system objects
‘FN’ Function

It searches for all database objects.

No comments:

Post a Comment