If you want to post a potential solution, you should be using an answer rather than posting a comment containing your guess answer. If you're unsure and could request clarification, that is often a good idea as CodeCaster indicates. It's best to avoid posting a speculative answer in the comments though.
A brief tangent on our model
This format works brilliantly to sort answers based on how useful they are, allowing correct answers to float to the top and wrong answers to sink. Not all questions can be answered definitively without clarification (such as more information, or clearing up an ambiguity). That's why comments exist—to clarify the post, or improve it so that it is answerable.
Answers in comments are discouraged because they bypass all of that. Your guess then sticks to the top of the page rather than being sorted and vetted by others.
In your case
Here's your answer:
You are selecting your SELECT line with mouse/keyboard and executing, thus not running at the same time (same batch, as Larnu says) the declare statement. @ is not #, you have to run it at the same time.
Though it is a guess, it doesn't sound like a request for clarification. I'd say you should just post it as an answer.
But what if it's wrong? Sometimes, your guesses will be wrong (if they're anything like mine!). You should still post it as an answer to allow others to vet your post, though—if you're wrong, you can just accept that and either delete the answer and try again later with another answer, or edit to fix your post.
There's no need to relegate your answer to the comments just because you're unsure. Go ahead and post your answer, and (as always) be ready to accept feedback and improve your post if necessary.
Posting a potentially wrong answer as a comment just means that it's pinned to the top, above the actual answers section. Comments can only be upvoted, so there's no way to signal an incorrect comment (other than posting yet another comment, which often spirals into a discussion rather than the tidy Q&A format that the system is designed for).
This advice doesn't necessarily apply if you're guessing due to a lack of information from the question. In that case, you should post a comment asking for more information, and vote to close as "unclear what you're asking". My advice above applies in the case that you're simply not sure of your answer being correct rather than not being sure what the author wants.