r/SQL • u/kaatarina_zed_talon • Oct 15 '26
SQL Server Statistics on columns of a table
Limitations of table-valued parameters:
SQL Server does not maintain statistics on columns of table-valued parameters.
statistics of what ? why those statistics even exist for non table-valued parameters ?
4
Upvotes
View all comments
Show parent comment
1
u/kaatarina_zed_talon Oct 15 '26 edited Oct 15 '26
The reason I was searching about table-valued parameters is that I want to veryift the integrity of a junction table's data; for example, a table called `BrandsSuppliers` has two foreign key columns `BrandId` and `SupplierId`, the principle tables are `Brands` and `Suppliers`. I want to ensure that every `BrandId` gets the correct value for `SupplierId`, so I want a fucntion that takes the `BrandsSuppliers` table as a parameter, do some logic, and return a boolean value that indicats whether every `BrandId` got the right value for `SupplierId`