2011-06-16 45 views

回答

3
if exists(select top 1 NULL from <your_table_name>) 
begin 
    --do something if you need 

    select col1, col2,... from <your_table_name> 
    where <your_condition> 

    --do other things if needed 
end 
else 
    return <-- this will stop right here and return 
4

這取決於上下文中存儲過程的用法,但RETURN是最簡單和最直接的解決方案。