2010-03-01 9 views

Antwort

11

wie diese

--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