select p.ProductID , pm.ProductModelId, pc.productCategoryId, pd.ProductDescriptionID, p.Name as Product, pm.Name as Model,pc.Name as Category, pd.Description as Description
from Product p
inner join ProductModel pm on pm.ProductModelID = p.ProductModelID
inner join ProductCategory pc on pc.ProductCategoryID = p.ProductCategoryID
inner join ProductModelProductDescription pmpd on pmpd.ProductModelID = p.ProductModelID
inner join ProductDescription pd on pd.ProductDescriptionID = pmpd.ProductDescriptionID
where pd.Description not like '%?%'
order by 1
;
SELECT 'Last_query_cost' AS [Variable_name], dbo.ufnGetQueryCost('select p.ProductID , pm.ProductModelId, pc.productCategoryId, pd.ProductDescriptionID, p.Name as Product, pm.Name as Model,pc.Name as Category, pd.Description as Description
from Product p
inner join ProductModel pm on pm.ProductModelID = p.ProductModelID
inner join ProductCategory pc on pc.ProductCategoryID = p.ProductCategoryID
inner join ProductModelProductDescription pmpd on pmpd.ProductModelID = p.ProductModelID
inner join ProductDescription pd on pd.ProductDescriptionID = pmpd.ProductDescriptionID
where pd.Description not like ''%?%''
order by 1
') AS [Value];