摘要: 笔者作为一个菜鸟,没什么好分享的,就把在学习期间的一点小心得拿出来晒晒。学习数据库的时候层突发奇想能不能根据表名直接找出来该表的主键,进而可以进行排序之类的操作,下面就把自己的具体实现分享给大家吧!1、查询表名(tblstudent为例)的id号select id from sysobjects where type='U' and name='tblstudent'2、查询tblstudent表的主键select name from sys.sysobjects where xtype='PK' and parent_obj=117575457 阅读全文
posted @ 2012-03-03 18:21 轻狂の书生 阅读(2598) 评论(0) 推荐(1) 编辑