declare @cnt int
select @cnt=count(*) from table1
select *,@cnt as cnt from table1