Skip to content

sp_QuickieStore: Regression mode seems to have lost some defaults #611

@ReeceGoding

Description

@ReeceGoding

Version of the script
Current dev branch.

What is the current behavior?

DECLARE @TwoWeekAgo datetimeoffset(7) = DATEADD(WEEK, -2, SYSDATETIMEOFFSET());

EXEC dbo.sp_QuickieStore
    @database_name = 'StackOverflow2013',
    @sort_order = 'logical reads',
    @regression_baseline_start_date = @TwoWeekAgo;

Errors at run time with

Msg 515, Level 16, State 2, Procedure dbo.sp_QuickieStore, Line 1524
Cannot insert the value NULL into column 'column_source', table '@ColumnDefinitions'; column does not allow nulls. INSERT fails.

If the current behavior is a bug, please provide the steps to reproduce.
As above.

What is the expected behavior?
Use the documented defaults and not fail at run time. Alternatively, give an error that a user can fix without reading the source code.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
It fails on the current dev branch. However, I know that this worked in older versions (e.g. 5.1 worked) because the above is exactly the same code that I put in the old examples file. I knew that working through it line by line would be handy for catching issues! I'm nearing the end of it now.

IMPORTANT: If you're going to contribute code, please read the contributing guide first.
https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md
Yeah, I'll work on fixing it today.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsp_QuickieStoreFor the loving of Query Store

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions