`
shmilylq
  • 浏览: 56378 次
  • 性别: Icon_minigender_2
  • 来自: 北京
最近访客 更多访客>>
sxu
文章分类
社区版块
存档分类
最新评论

根据syscolumns得到id所对应的表

 
阅读更多
查看字段所属表
select * from dbo.sysobjects where id in
(select id from dbo.syscolumns where name='列名')
分享到:
评论

相关推荐

    oracle查表字段

    下面为您介绍的是查询表的字段名的sql语句写法,sql语句可以实现许多的功能,希望可以您在学习sql语句使用方面获得启示。 1. select name from syscolumns where id = (select id from sysobjects where type = 'u' ...

    在SQL Server中实现数据的数组式读取.pdf

    所以,如果将表名设为字符型变量@tab,用于表 示变化中的表名,与之相匹配的编号(ID—OBJECTID(@tab))所对应的表的总行数就是其所具有的总列数。即总列数可以通过以下命令获取,只要用相应变量记下该函数的值,很...

    数据库操作语句大全(sql)

    根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明...

    sql语句大全 包括常有语句 新手必备

    select name from syscolumns where id=object_id('TableName') 22、说明:列示type、vender、pcs字段,以type字段排列,case可以方便地实现多重选择,类似select 中的case。 select type,sum(case vender

    sql语句查询数据库中的表名/列名/主键/自动增长值实例

    —docs为表名 —- select * from syscolumns where id = object_id(‘docs’) —-查询数据库中所有类型 —-select name,xtype from systypes —-两表联查,显示表中所有字段和对应的数据类型 —-s

    ddl语言自定义数据库字段

    from syscolumns where id=object_id('"& tableName2 &"') and name='"& a_name &"'" Call gRsClose() oRs.Open eSql,oConn,1,3 if not oRs.EOF then Call ErrorMsg(sFileName,"主表中字段...

    经典全面的SQL语句大全

    select name from syscolumns where id=object_id('TableName')  22、说明:列示type、vender、pcs字段,以type字段排列,case可以方便地实现多重选择,类似select 中的case。 select type,sum(case vender when 'A...

    经典SQL语句大全

    根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明...

    sql经典语句一部分

    根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明...

    超实用sql语句

    根据已有的表创建新表: A:create table tab_new like tab_old (使用旧表创建新表) B:create table tab_new as select col1,col2… from tab_old definition only 5、说明:删除新表 drop table tabname 6、说明...

Global site tag (gtag.js) - Google Analytics