Native query parameters and privacy
Bind values without building SQL text
A native query is written in the source language, such as T-SQL. Parameter binding keeps a query template separate from data values; do not construct SQL by concatenating a learner-supplied value. Binding support and parameter conventions depend on the connector. An approved database target and least-privilege credentials remain necessary. A parameter is not permission to choose any database or table, and value parameters generally cannot replace SQL identifiers. Use fixed approved objects. Native query approval is a separate safeguard, not evidence that a query is safe.
Example 1: a parameterized native SELECT
Optional SQL Server lab only: the preapproved labServer and labDatabase parameters identify a disposable database with dbo.Sales. The example is static, not native-verified. Value.NativeQuery accepts a target, query text, optional parameters and optional options. For SQL Server, the example supplies a record for the named parameter. Keep the query read-only and inspect it before approving execution.
let DB = Sql.Database(labServer, labDatabase), SelectedRegion = "North", Result = Value.NativeQuery(DB, "SELECT LineID, Quantity FROM dbo.Sales WHERE Region = @region", [region = SelectedRegion])in ResultExpected North: three rows, 4 units. Changing the parameter to South gives two rows, 5 units. Use an explicit region allowlist for this business task and reject unknown regions instead of assuming they are authorized. No credentials, actual endpoint or query execution is included. The SQLite lab binds its own placeholder syntax, not SQL Server syntax.
Example 2: native query folding is a separate capability
Some connectors support folding subsequent transformations over native SELECT queries with EnableFolding = true. The following is a separate static SQL Server example, with no bound parameter, to isolate that documented option. Its behavior depends on connector and host support and the query being suitable for further translation.
let DB = Sql.Database(labServer, labDatabase), Base = Value.NativeQuery(DB, "SELECT LineID, Region, Quantity FROM dbo.Sales", null, [EnableFolding = true]), North = Table.SelectRows(Base, each [Region] = "North")in NorthExpected three North rows. This option requests folding support; it is not a guarantee. Do not assume combining it with bound parameters works identically in every connector. Verify on the exact version with a documented diagnostic surface.
Protect data when combining sources
Power Query privacy levels classify sources (Public, Organizational, Private) for evaluating data movement during combination. They are not access permissions, RLS or a substitute for source authorization. The Data Privacy Firewall helps prevent unintended disclosure, such as a private customer identifier being sent to an external source as part of a folded join. An external catalog and internal orders may be independently accessible but not approved for cross-source transmission. On a Formula.Firewall error, review classifications, source boundaries, query structure and approved data movement; ask the data owner. Do not disable privacy protections or relabel private data to make a query faster. Use synthetic data and independently approved execution in a disposable lab. Never expose connection secrets in diagnostics or report files.
Practice: design a safe filter
An approved report filters an internal sales view by North or South. Describe the query template, bound values and allowlist, and what must happen if someone chooses an unapproved region. A separate public catalog is required: explain what privacy review is needed before joining. Identify which evidence would be necessary to claim the parameterized query or subsequent transformations actually folded.
Official reading
native · native-folding · native-approval · privacy · firewall · security