How to query the information of a database in sql server 2005

use job

SELECT * FROM sysobjects WHERE (xtype = 'U') -- how many tables the query has

 

SELECT * FROM sysobjects WHERE (xtype = 'V') -- how many views the query has

SELECT * FROM sysobjects WHERE (xtype = 'P') -- how many stored procedures the query has

 

Query the tables created by all users in the current database

xtype char(2) Object type. Can be one of the following object types: 
C = CHECK constraint 
D = default or DEFAULT constraint 
F = FOREIGN KEY constraint 
L = log 
FN = scalar function 
IF = inline table function 
P = stored procedure 
PK = PRIMARY KEY constraint (type is K) 
RF = Replication Filter Stored Procedure 
S = System Table 
TF = Table Function 
TR = Trigger 
U = User Table 
UQ = UNIQUE Constraint (Type is K) 
V = View 
X = Extended Stored Procedure

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326520520&siteId=291194637