what is the wrong with
insert into #tempA(MailSize)
EXEC sp_foreachdb_dev @command = N' USE ?
SELECT (size * 8)/1024.0 AS size_in_mb FROM
sys.database_files WHERE
data_space_id = 0',
@user_only = '1'
select * from #tempA
i want to store size of the log file in a temp table
Numerous problems:
sp_msforeachdb
@command1
@user_only
parameter.The version below works:
create table #tempA (
MailSize decimal
)
insert into #tempA(MailSize)
EXEC sp_msforeachdb
@command1 = N' USE ?
SELECT (size * 8)/1024.0 AS size_in_mb
FROM sys.database_files
WHERE data_space_id = 0'
select * from #tempA
drop table #tempA