Load sysobjects from SQLServer

/* select name from sysobjects where xtype='u' ---
   C = CHECK CONSTRAINTS
   D = DEFAULT CONSTRAINTS
   F = FOREIGN KEY CONSTRAINTS
   L = LOG
   FN = SCALAR FUNCTION
   IF = EMBEDDED TABLE FUNCTION
   P = STORED PROCEDURE
   PK = PRIMARY KEY CONSTRAINTS
   RF = REPLICATION FILTERING STORED PROCEDURES
   S = SYSTEM TABLE
   TF = TABLE FUNCTION
   TR = TRIGGER
   U = USER TABLE
   UQ = UNIQUE CONSTRAINTS
   V = VIEW
   X = EXTEND STORED PROCEDURE
   */

Load all User Table list:

SELECT name FROM sysobjects WHERE xtype='U' AND name <> 'dtproperties' ORDER BY name ASC;

Load all User View list:

SELECT name FROM sysobjects WHERE xtype='V' AND name <> 'dtproperties' ORDER BY name ASC;

Load User Function list:

SELECT name FROM sysobjects WHERE xtype='FN' AND name <> 'dtproperties' ORDER BY name ASC;

Load stored procedures list:

select * from dbo.sysobjects where OBJECTPROPERTY(id, N'IsProcedure') = 1 order by name

Load stored procedure modify context:

EXEC sp_helptext {stored_procedure_name}

Load view context:

EXEC sp_helptext {view_name}

Leave a Comment