I am using the code from this website (up until the end of the first case statement)-

<http://www.sqlusa.com/bestpractices2005/abbreviation/>

```
DECLARE @StateCode char(2)
SET @StateCode = 'TX'
SELECT 'State name from state code' =
CASE 
WHEN @StateCode = 'AK' THEN 'ALASKA'
WHEN @StateCode = 'AL' THEN 'ALABAMA'...
...WHEN @StateCode = 'WV' THEN 'WEST VIRGINIA'
WHEN @StateCode = 'WY' THEN 'WYOMING'
ELSE '' END
GO

```

This code runs fine if I copy / paste from the website directly into SSMS. 

If I copy / paste this code (from the website) into Excel, and then copy / paste from Excel to SSMS, the code will not run anymore even though it is visibly the same as the original code. SSMS is bringing up syntax errors all throughout the code. 

The problem seems to be with the space (" ") characters; If replace all of the "space characters" with "real" spaces, the errors will go away and the code will run correctly.

Why is this happening?