Forum Discussion
Row-Level Security (RLS) with INLINE or SCHEMABINDING
- 8 months ago
Yes — the function used for the RLS predicate should be INLINE.
That’s the expected type of function for RLS because it lets the engine fold the predicate directly into the query plan.SCHEMABINDING is just an additional option you apply on top of the inline function when you want stability and to prevent accidental schema changes.
So the correct combination is:
INLINE TVF → required
SCHEMABINDING → recommended/commonly used
Did I answer your question? Mark my post as a solution!
GopiKrishna
Hi tan_thiamhuat ,
For RLS in Fabric / SQL, the predicate must be an INLINE table-valued function. That’s the required format for a row-level security filter, and it allows the engine to treat the predicate as part of the main query plan.
SCHEMABINDING is a separate option, and it is generally recommended. When a security policy is created with schemabinding turned on (which is the default), the predicate function also has to be created with WITH SCHEMABINDING. This prevents accidental schema changes that could break or change the RLS logic.
So the usual guidance is:
Use INLINE TVF → required for RLS.
Use SCHEMABINDING → recommended for production, and often mandatory depending on the policy settings.
In short: use an inline function for the predicate, and apply schemabinding unless you have a specific development-time reason not to.
GopiKrishna