2010-03-01 9 views

risposta

11

come questo

--will not count NULLS 
select @totalrecs= count(id) from table1 

--will count NULLS 
select @totalrecs= count(*) from table1 
1
select @totalrecs= count(id) from table1 
2

DECLARE @totalCount Int 
Select @totalCount = count(*) 
From table1 

Exec sp_DoSomething @Var = @totalCount 
Problemi correlati