Hi,
Please, I'm developing a web application and I have two tables that could be many many records. I need make a query search (stored procedure) that limit the result to 20 records for page.
I think that I must use ROW_NUMBER ou create a temp table, but the fact is that I don´t know why.
Can you help me?
Thanks
Marcos Cruz, São Paulo, Brasil
SELECT s.SetorAtividadeId
,s.SetorAtividade
,rAtividade.RamoAtividadeId
,rAtividade.RamoAtividade
FROM
SetorAtividade As s
LEFT OUTER JOIN
RamoAtividade as r
ON s.SetorAtividadeId = r.SetorAtividadeId
WHERE
(s.SetorAtividade LIKE @param)
ORDER BY
sAtividade.SetorAtividade
,r.RamoAtividade