I am using sp_BlitzCache
version 4.1 (20161210)
and executing it on a 2008R2 instance (10.5.4042)
.
If I execute the sp without the @OutputDatabaseName, @OutputSchemaName, and @OutputTableName
, it works fine. However, when I set those values, it runs through its process and at the very end, and error appears:
"The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns."
The specific statement I am running is:
EXEC [dbo].[sp_BlitzCache] @OutputDatabaseName = 'Maintenance_Stats'
,@OutputSchemaName = 'dbo'
,@OutputTableName = 'BlitzCacheResults'
The database, schema, and table already exist, but has no records in it. So...somewhere in the sp code, it created the table, but is trying to stuff too many values into the table.
I am using this to try to troubleshoot an application (SCCM) hang issue, and as recommended, have created a SQL Agent job that the helpdesk can execute when they encounter the issue (it is intermittent), but I tried executing it myself, and it failed with the above error.
-
Is there anywhere in the BlitzCache procs that creates the table? If so, can you just drop (or just rename) the existing table and have the process re-create it? I'm assuming it may just be an outdated table with less columns than the version used by the BlitzCache Procedure.SQLDevDBA– SQLDevDBA2017年02月09日 22:36:29 +00:00Commented Feb 9, 2017 at 22:36
-
1I believe that is fixed in the latest sp_blitzcacheHannah Vernon– Hannah Vernon ♦2017年02月09日 22:39:26 +00:00Commented Feb 9, 2017 at 22:39
-
are you using this version github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/…Kin Shah– Kin Shah2017年02月09日 22:41:41 +00:00Commented Feb 9, 2017 at 22:41
1 Answer 1
The comments are right, but I figured I'd chime in. That is fixed in the latest release
Full disclosure: I am owned and operated by Brent Ozar Unlimited, and contributed both the bug and the bug fix to this code.
On my birthday.
-
Haha, happy birthday!Aaron Bertrand– Aaron Bertrand2017年02月09日 23:37:28 +00:00Commented Feb 9, 2017 at 23:37
Explore related questions
See similar questions with these tags.