sp; --print ''''丢失前记录:''''+ @customerid1+'''' ''''+@opcount1+'''' ''''+@dt1+'''' ''''+@statid1+'''' ''''+@port1+'''' ''''+@term1 --print ''''丢失后记录:''''+ @customerid2+'''' ''''+@opcount2+'''' ''''+@dt2+'''' ''''+@statid2+'''' ''''+@port2+'''' ''''+@term2 end fetch next from pk_rec into @customerid1,@opcount1,@dt1,@statid1,@port1,@term1 fetch next from pk_rec into @customerid2,@opcount2,@dt2,@statid2,@port2,@term2 end close pk_rec deallocate pk_rec fetch next from pk_custid into @customerid end close pk_custid deallocate pk_custid