Thanks. got it to work correctly with this query:
if exists(select top 1 * from sys.databases where is_auto_close_on = 1)
select COUNT(*),name
from sys.databases
where is_auto_close_on = 1
group by name
else
select 0, '';
Thanks. got it to work correctly with this query:
if exists(select top 1 * from sys.databases where is_auto_close_on = 1)
select COUNT(*),name
from sys.databases
where is_auto_close_on = 1
group by name
else
select 0, '';