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