Hello!
Is it possible to use a set, like (1, 2, 3, 4, 5) for example, as inparameter to a Sproc, function or view in SQL Server 2008?
What should I use of Sproc, function or View for this pice of SLQ?
WITH Scores AS(
SELECT
ItemId, SUM(Score) AS Score
FROM [Presenta].[presenta].[LpivScores]
WHERE
// HERE I want (1, 2, 3, 4, 5) to be the inparameter, like @inParam
ListPropertyItemId IN (1, 2, 3, 4, 5)
GROUP BY
ItemId
)
// I want this to be returned
SELECT
i.Id,
s.Score
FROM
Scores s,
Items i
WHERE
s.ItemId = i.Id
Any help is greatly appreciated!