Skip to content

Commit

Permalink
Clarified how @get_all_databases and @database_name work with system …
Browse files Browse the repository at this point in the history
…databases.

@get_all_databases skips system databases. @database_name works on system databases even when no @database_name is specified.
  • Loading branch information
ReeceGoding committed Oct 20, 2024
1 parent 4966f76 commit 2cb981f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Current valid parameter details:

| parameter_name | data_type | description | valid_inputs | defaults |
|-----------------------------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------------------------------------------|
| @database_name | sysname | the name of the database you want to look at query store in | a database name with query store enabled | NULL; current non-system database name if NULL |
| @database_name | sysname | the name of the database you want to look at query store in | a database name with query store enabled | NULL; current database name if NULL |
| @sort_order | varchar | the runtime metric you want to prioritize results by | cpu, logical reads, physical reads, writes, duration, memory, tempdb, executions, recent | cpu |
| @top | bigint | the number of queries you want to pull back | a positive integer between 1 and 9,223,372,036,854,775,807 | 10 |
| @start_date | datetimeoffset | the begin date of your search, will be converted to UTC internally | January 1, 1753, through December 31, 9999 | the last seven days |
Expand Down Expand Up @@ -269,7 +269,7 @@ Current valid parameter details:
| @query_type | varchar | filter for only ad hoc queries or only from queries from modules | ad hoc, adhoc, proc, procedure, whatever. | NULL |
| @expert_mode | bit | returns additional columns and results | 0 or 1 | 0 |
| @format_output | bit | returns numbers formatted with commas | 0 or 1 | 1 |
| @get_all_databases | bit | looks for query store enabled databases and returns combined results from all of them | 0 or 1 | 0 |
| @get_all_databases | bit | looks for query store enabled user databases and returns combined results from all of them | 0 or 1 | 0 |
| @workdays | bit | use this to filter out weekends and after-hours queries | 0 or 1 | 0 |
| @work_start | time | use this to set a specific start of your work days | a time like 8am, 9am or something | 9am |
| @work_end | time | use this to set a specific end of your work days | a time like 5pm, 6pm or something | 5pm |
Expand Down
4 changes: 2 additions & 2 deletions sp_QuickieStore/sp_QuickieStore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ BEGIN
WHEN N'@expert_mode' THEN 'returns additional columns and results'
WHEN N'@hide_help_table' THEN 'hides the "bottom table" that shows help and support information'
WHEN N'@format_output' THEN 'returns numbers formatted with commas'
WHEN N'@get_all_databases' THEN 'looks for query store enabled databases and returns combined results from all of them'
WHEN N'@get_all_databases' THEN 'looks for query store enabled user databases and returns combined results from all of them'
WHEN N'@workdays' THEN 'use this to filter out weekends and after-hours queries'
WHEN N'@work_start' THEN 'use this to set a specific start of your work days'
WHEN N'@work_end' THEN 'use this to set a specific end of your work days'
Expand Down Expand Up @@ -259,7 +259,7 @@ BEGIN
defaults =
CASE
ap.name
WHEN N'@database_name' THEN 'NULL; current non-system database name if NULL'
WHEN N'@database_name' THEN 'NULL; current database name if NULL'
WHEN N'@sort_order' THEN 'cpu'
WHEN N'@top' THEN '10'
WHEN N'@start_date' THEN 'the last seven days'
Expand Down

0 comments on commit 2cb981f

Please sign in to comment.