Sybase objects/types

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
--###############################################################
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值