1.假设针对SYBASE ASE:
select count(*) into :ll_rows from sysobjects
where ......
//此处略,可找个具体库参考一下;
2.select count(*) into :ll_rows from s1;
select count(*) into :ll_rows from s2;
select count(*) into :ll_rows from s3;
判断SQLCA.SQLCODE和LL_ROWS变量;
3.你可在第一次运行时往注册表中写点东东,以后检测即可判断;