Sqlsever small operating statistics

Statistical data in the database Sqlsever some small recipe:

 1 #sql server 数表:
 2 
 3 select count(1) from sysobjects where xtype='U'
 4 
 5 #数视图:
 6 
 7 select count(1) from sysobjects where xtype='V'
 8 
 9 #数存储过程
10 
11 select count(1) from sysobjects where xtype='P'
12  
13 
14 
15 SELECT * FROM sysobjects WHERE (xtype = 'U')
16 
17 # C = the CHECK constraint 
18 is  # D = Default or DEFAULT constraint 
. 19  # F. = A FOREIGN KEY constraint 
20 is  # L = log 
21 is  # FN = scalar function 
22 is  # the IF = inline table function 
23 is  # P = stored procedure 
24  # the PK = PRIMARY KEY constraints (type K) 
25  # the RF = replication filter stored procedure 
26 is  # S = system table 
27  # TF = table function 
28  # TR = trigger 
29  # the U-= user table 
30  # UQ = UNIQUE constraint (type K ) 
31 is  # V = view 
32  # X-stored procedure extended =
33 is  
34 is  # This is the query information for all tables 
35  
36 SELECT * from the sysobjects WHERE xtype = ' the U- ' 
37 [  
38 is  # This is a look-up table of the number 
39  
40 SELECT COUNT (*) from the sysobjects WHERE xtype = ' the U- '  
41 is  
42 is  # which rapid data queries all table 
43 is SELECT a.name, b.rows from the sysobjects a with (NOLOCK) with the Join the sysindexes B (NOLOCK) ON = a.id b.id a.xtype = WHERE ' the U- '  and B .indid in (0, 1) the Order by a.name asc

 

Guess you like

Origin www.cnblogs.com/meipu/p/11425250.html