Insert cursor result into a table I have the below query and would like to insert the result into a table I created in Sql Server. Is there a way this can be done? The idea behind I'll create a SQL Agent job where the cursor result is stored on a table within my database.

Declare @DB sysname, @SQL nvarchar(4000)    
Declare DBCur Cursor for Select Quotename(Name) from sys.databases where name like '%Prod%' 
Open DBCUR  
Fetch Next from Dbcur into @DB  
While @@Fetch_Status = 0    
Begin   

      Set @SQL = 'select /*@@Servername as servername,*/ '+ Char(39) + @DB + Char(39)+' as databasename, o.Name as triggerName from '+@DB +'.'+'sys.objects o inner join  '+@DB +'.'+'sys.triggers t    
      on o.[object_id] = t.[object_id]  
            where o.type = ''TR''   
            and t.is_disabled = 0'  
      Print @SQL    
      Exec SP_ExecuteSQL @SQL   
      Fetch Next from Dbcur into @DB    
end 
CLose DBCur 
DEAllocate DBCUr
You will need the table to exist and have all the columns returned by your statement.

Then you can run something like:

INSERT INTO MyTable Exec (@SQL);