Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI OLEDB Enterprise

OPTION (ALLOW EXPENSIVE)

  • Last UpdatedFeb 07, 2023
  • 1 minute read

Unrestricted queries for a number of tables are considered expensive. To protect the system from unintended load, such queries will return an error. For example:

SELECT ea.*
FROM [NuGreen].[Asset].[ElementAttribute] ea
OPTION (FORCE ORDER)

returns the following error:

[NuGreen.Asset.ElementAttribute ea] 'ElementID' column is not restricted. Such a query is considered expensive.

Possible solutions:

  • Add a join with ElementHierarchy or Element table or, if the join is already present, reorder tables in the FROM clause and use the OPTION (FORCE ORDER) query hint.

  • Add OPTION (ALLOW EXPENSIVE) query hint.

    Setting the Option overwrites the standard behavior and allows the query to run.

Related Links
TitleResults for “How to create a CRG?”Also Available in