我想提高错误if exists
,然后print
是匹配的行数。但这不起作用。请帮忙 。
if exists (select * from [rto] a
inner join rt b
on a.NUM=b.TABLE_NAME
where a.START_YEAR between b.YEAR_START and b.YEAR_STOP)
Raiserror ('Matched recs found',16,1)
print 'There are' + cast(@@rowcount as varchar(20)) + 'matched rows'