I am trying to make a simple query to my server and want the result to be stored in the variable @times.
DECLARE @times int
SET @times = SELECT COUNT(DidWin)as "I Win"
FROM thetable
WHERE DidWin = 1 AND Playername='Me'
IntelliSense says Wrong syntax near Select
You just need parentheses around your select:
Or you can do it like this: