Hi.. this is how I got a proc to run on all dbs
you need to create the proc from the statement(s) on each database (using your standard distribution methods I assume - if you know how to do this please let me know - just learning)
Create procedure indexlist
as
select db_name() 'DataBase',object_name(x.id) tblnm,x.name 'index name',
--rest of query
order by IndexSizeKb desc
go
Then you can use sp_MSforeachdb such as.....
EXEC sp_MSforeachdb @command1 = "Use ? Exec indexlist"