[求助]表的是否为主键在什么系统表里
RT.谢谢
2006-04-04 17:22
2006-04-04 17:26
2006-04-04 17:28
2006-04-04 17:45
2006-04-04 17:53
2006-04-04 17:56
2006-04-04 18:08
2006-04-04 19:23
不呀,这个存储过程我以前就会.
它好像不能指定列名吧!
你看一下我写的吧,帮我改一下.谢谢
declare @objid int
declare @objname char(40)
select @objname = 'tablename'
select @objid = id from sysobjects where id=object_id(@objname)
select a.name as '列名',b.name as '数据类型',a.length as '长度',
(case when a.isnullable='1' then '是'else '否'end ) as '允许空'
from syscolumns a,systypes b where a.id = @objid and b.xtype in
(select xtype from syscolumns where id = @objid )
现在就要判断其主键了,我就不知道怎么判断了.
2006-04-05 09:01
[此贴子已经被作者于2006-4-6 13:07:56编辑过]

2006-04-06 13:05