Blog Pages

Create filtered statistics

Create Statistics <StatisticsName> 
On <TableName>(<columns list>) 
Where <condition>

Example:
CREATE STATISTICS ContactPromotion1
    ON Person.Person (BusinessEntityID, LastName, EmailPromotion)
WHERE EmailPromotion = 2

Permissions list of the connected user

SELECT * FROM fn_my_permissions (NULL, 'DATABASE');