日期:2014-05-17 浏览次数:20472 次
DECLARE @CountID int SELECT @CountID=COUNT(*) FROM Accounts_Comments WHERE UserID = @UserID IF @CountID=0 ELSE
------解决方案--------------------
IF (SELECT COUNT(1) FROM Accounts_Comments WHERE UserID = @UserID)=0 PRINT 'No Data for '+@UserID else ...
------解决方案--------------------
--日,这个地方count(*)要改,不然会一直存在一条记录,忘记改了 IF not exists (select 1 from Accounts_Comments WHERE UserID = @UserID) ELSE