Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ストアド プロシージャを実行して行がフェッチされない場合に備えて、行の値としてカスタム値を返したいのですが、それを行う方法はありますか?
if 0 = (select count(*) from tbl where conditions) select 'None' as s, 0 as n else select s, n from tbl where conditions
選択ではなくプロシージャから行が返される場合は、一時テーブルに対して実行してから、同じ演習を行います。このような:
create table #tmp (s varchar(17), n integer) insert into #tmp execute myproc