texting error in ssms when produce output

Guys,
I have one weird problem, Ok , I have a practice to  copy all my working syntax  to Office notes but then if I  copy - paste again the syntax to ssms query output, I  have a problems as per my screenshot.

 ssms_error.PNG
motioneyeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

motioneyeAuthor Commented:
Guy,

Let me just copy the syntax here , pls you can try

select @@servername -- This is copy and paste from Microsoft office notes
go
select @@servername -- This is typing
Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
I suspect you have a special character(s) sneaking in. It happens when switching to and from an application that supports HTML or represents tabs and spaces in a different way. If you have a binary editor, suggest you paste the problem string there and I am sure you will find something that's not a space or a tab, but looks like a space in the editor.
Vitor MontalvãoMSSQL Senior EngineerCommented:
Unfortunally this sometimes happens in Windows environment. First time I face something similar was more than 20 years ago with Windows 3.1 and the issue persists.
Copy/paste between applications can bring some hidden characters so when this happens only solution is to type the command yourself to be clear of unwanted characters.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony PerkinsCommented:
"--" in MS Office is converted to "–" , hence your problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.