Answered by:

Column name or number of supplied values does not match table definition

Question

Im using the below query to get the top long running query against all databases in my sql server. The quey works in a single database. It is alo working with Msforeachdb but when i try to insert the results in a temp table to get it as a single result set,Im
getting this error:

Column name or number of supplied values does not match table definition

Glad to hear that the issue is solved by yourself and thanks for you sharing. The Insert Error message that Column name or number of supplied values does not match table definition appears when the column names or the supplied values used in the INSERT statement
do not match those of the table definition.

Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.