i have z query that select 5 rows from 100,000 rows, there is a field named "VIEW" that must increment if the row have been selected. so when i select this 5 rows , i should increment VIEW field of them. do can i update VIEW in the select line or not?
and is it possible execute SP on Select?
ALTER PROCEDURE [dbo].[sp_MyProc]
with cte as
select top 5 id from myTable
where (active=1) order by newid()
select top 5 * from cte c
inner join myTablet on t.id = c.id
Best Regards. Morteza
View Complete Post