--- 把结果保存到一个表中(可以是固定表也可以是临时表)。
IF not Exists (Select 1 From database.dbo.sysobjects Where Name = 'TestTable' and xType = 'U' )
Begin
select count(*) as Cou Into TestTable from table
End
Else Begin
Delete From TestTable
Insert Into TestTable (Cou)
select count(*) as Cou Into TestTable from table
End