Stored Query Maintenance
HelpID: 460022022
Stored Queries provide the ability to create and store ad hoc tSQL queries that can be executed in a secure manner by an end-user. An administrator can create a query which an end user can run, but the user will not be able to view the query or make any changes to it. A query can also have parameters, such as an Item Number, which the user must provide before running the query.
Navigation: Tools >> Utilities >> System >> Stored Query Maintenance
Query ID: Provide an ID for the Query.
Name: When a user runs a Stored Query, they will use the Execute Stored Query window. The Execute Stored Query window has a drop-down list of Stored Query Names that the user has access to.
Description: Description is also displayed in the Execute Store Query window to help the user identify what the query does.
Execute Only: The user will be able to select and run the query, but it will provide no feedback to the user other than completion status. A query must be marked as Execute Only for it to appear in the Execute Stored Query window.
Show Results: The Execute window will display the results of the query. The Show Results option also enables the Export To Excel button on Execute Stored Query. Otherwise the Excel button is hidden.
Email Results: The Execute window will automatically export the results to a CSV file, create an email to the specified Email address, and attach the file to the email.
Email: The email results are sent to this address.
Execute In Database: Select the database in which the query will be executed. When the Execute Stored Query window is opened, it will only show users queries to which they have been granted security, and which are assigned to the current company database or DYNAMICS database. The “All Companies” option means that the query will be available in all company databases (not that it will execute across all databases at the same time).