select column1,column2,@@ROWCOUNT as rows from table
select *, rowcnt = count(*) over() from MyTable
select *, (select count(*) from table) from table
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)