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
You just need parentheses around your select:
SET @times = (SELECT COUNT(DidWin) FROM ...)
Or you can do it like this:
SELECT @times = COUNT(DidWin) FROM ...