>Hi Sergey,
>
>I could not get the syntax right to insert a value and a result of SP. Here is what I've tried and then have to drop table name:
>
--create table #temp (TableName varchar(128), Statistics_Name varchar(128), Statistics_Keys varchar(128))
--insert into #temp select 'aspnet_Roles' as TableName, execute sp_helpstats 'aspnet_Roles', 'ALL'
drop table #temp
create table #temp (Statistics_Name varchar(128), Statistics_Keys varchar(128))
insert into #temp execute sp_helpstats 'aspnet_Roles', 'ALL'
select * from #temp
I believe there is no way to combine static value and a result of SP in one insert statement and the only way seems to do it in 2 steps.
If it's not broken, fix it until it is.
My Blog