输入banner图图片脚本导航/分类

SQL Server —— 查询数据库、表、列等

*from sys.databases where name=MyDatabase

技术分享

二、查询表(sysobjects —— select *from sysobjects where id=OBJECT_ID(‘<表名>‘))

select *from sysobjects where id=OBJECT_ID(StudentsInfo)

技术分享

三、查询列(syscolumns —— select COUNT(*) from syscolumns where name=‘<列名>‘ and id=OBJECT_ID(‘<表名>‘))

select COUNT(*) from syscolumns where name=sname and id=OBJECT_ID(studentsinfo)

技术分享

 四、查询存储过程或视图(select * from sysobjects where name=‘<视图或存储过程名>‘  AND  type  =  ‘P/V‘)

SQL Server —— 查询数据库、表、列等

标签:_id   img   server   image   存储   style   数据库   name   databases