1、查询数据库中存在某一列名的表
use [db]
go
SELECT name FROM sysobjects WHERE id IN (SELECT id FROM syscolumns WHERE name = '列名' )
其中sysobjects,syscolumns 都是系统表,分别存储的是表信息和字段信息。
--------------------------------------------------------------------------------------
2、分页查询数据(用存储过程分页)~~~~
select * from (select row_number() over(order by id) as row,* from dbo.Person where isDel=0) as tt where row between (@pageIndex-1)*@pageSize+1 and @pageIndex*@pageSize
dbo.Person 为表名
id 为表里某列列名
@pageIndex 为当前页页数
@pageSize 为一页显示数据条数