C: checkÔ¼Êø
D: ĬÈÏÖµ,default constraint
F: Foreign Key constraint
L: logs
FN: ±êÁ¿²ÎÊý
IF: ÄÚ±í²ÎÊý
P: Stored Predure
PK: Primary Key Constraint
RF: ¸´ÖÆɸѡ´æ´¢¹ý³Ì±í
S: ϵͳ±í
TF:±í²ÎÊý
TR: ´¥·¢Æ÷
U:User table
UQ: Unique constraint
V:View
X: À©Õ¹´æ´¢¹ý³Ì
--#############################################################
Get columns(parameters) of table/view/procedures
--################################################################
select sc.name, sc.colid, st.name + '(' + convert(varchar, sc.length) + ')' as type,
allowNulls = case sc.status & 8 when 8 then 1 else 0 end
from sysobjects so
inner join syscolumns sc on sc.id=so.id
inner join systypes st on st.usertype=sc.usertype
where so.name='accountDelta' and so.type='V'
--################################################################
Get trigger of table/view
--################################################################
select b.name from sysobjects a, sysobjects b where a.name='trade' and b.id in (a.deltrig, a.instrig, a.updtrig, a.seltrig)
--################################################################
Get all databases
--################################################################
select name from master..sysdatabases
--################################################################
Get system logins
--################################################################
select name from master..syslogins
--################################################################
Get all system processes
--################################################################
exec sp_who
--###############################################################
Get database objects of a database(each db has a particular sysobjects)
--###############################################################
select name, type from sysobjects
--###############################################################
Get referential constraint (foreignKey constraints)
--###############################################################
select b.name from sysobjects a, sysobjects b, sysconstraints c where a.name ='jobParameters' and a.type = 'U' and c.tableid = a.id and b.id = c.constrid
--###############################################################
D: ĬÈÏÖµ,default constraint
F: Foreign Key constraint
L: logs
FN: ±êÁ¿²ÎÊý
IF: ÄÚ±í²ÎÊý
P: Stored Predure
PK: Primary Key Constraint
RF: ¸´ÖÆɸѡ´æ´¢¹ý³Ì±í
S: ϵͳ±í
TF:±í²ÎÊý
TR: ´¥·¢Æ÷
U:User table
UQ: Unique constraint
V:View
X: À©Õ¹´æ´¢¹ý³Ì
--#############################################################
Get columns(parameters) of table/view/procedures
--################################################################
select sc.name, sc.colid, st.name + '(' + convert(varchar, sc.length) + ')' as type,
allowNulls = case sc.status & 8 when 8 then 1 else 0 end
from sysobjects so
inner join syscolumns sc on sc.id=so.id
inner join systypes st on st.usertype=sc.usertype
where so.name='accountDelta' and so.type='V'
--################################################################
Get trigger of table/view
--################################################################
select b.name from sysobjects a, sysobjects b where a.name='trade' and b.id in (a.deltrig, a.instrig, a.updtrig, a.seltrig)
--################################################################
Get all databases
--################################################################
select name from master..sysdatabases
--################################################################
Get system logins
--################################################################
select name from master..syslogins
--################################################################
Get all system processes
--################################################################
exec sp_who
--###############################################################
Get database objects of a database(each db has a particular sysobjects)
--###############################################################
select name, type from sysobjects
--###############################################################
Get referential constraint (foreignKey constraints)
--###############################################################
select b.name from sysobjects a, sysobjects b, sysconstraints c where a.name ='jobParameters' and a.type = 'U' and c.tableid = a.id and b.id = c.constrid
--###############################################################