不是拼SQL语句的页面存储过程
ALTER PROCEDURE [dbo].[GetUsersList]
@BigClassID int=0,--大类别ID
@SmallClassID int=0 ,--小类别ID
@pageindex int=1,
@pagesize int=3,
@ret int output --共几条
AS
set rowcount @pagesize
if @SmallClassID>0
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,rank() over(order by id desc) as rownumber from Users where BigClassID=@BigClassID and SmallClassID=@SmallClassID
)t where t.rownumber>(@pageindex-1)*@pagesize;
set @ret=(select count(id) from Users where BigClassID=@BigClassID and SmallClassID=@SmallClassID);
end
else
begin
select * from(
select id,BigClassName,SmallClassName,UserName,Corporation,rank() over(order by id desc) as rownumber from Users
)t where t.rownumber>(@pageindex-1)*@pagesize;
set @ret=(select count(id) from Users) ;
end
相关文档:
What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers ......
一、 注入式攻击的类型
可能存在许多不同类型的攻击动机,但是乍看上去,似乎存在更多的类型。这是非常真实的-如果恶意用户发现了一个能够执行多个查询的办法的话。本文后面,我们会对此作详细讨论。
如果你的脚本正在执行一个SELECT指令,那么,攻击者可以强迫显示一个表格中的每一行记录-通过把一个例如"1=1"这 ......
D:\projects\openi\misc\xxxx_data_20090828>bcp [xxxxolap].[dbo].[wdb_cxbz] in wdb_xxx.txt -c -T
SQLState = 37000, NativeError = 4060
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot open database "xxxolap" requested by the login. The login failed.
S ......
1
、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select
*
from
people
where
peopleId
in
(
select
peopleId
from
people
group
by
peopleId
having
cou ......