create procedure usp_myphotos@pageIndex int,@pageSize int,@pageCount int outputasdeclare @n intselect @n=count(*) from photosset @pageCount=ceiling(@n*1.0/@pageSize)select top (@pageSize) * from photos where pid not in (select top ((@pageIndex-1)*@pageSize) pidfrom photos order bypid asc)order by pid as...